Commit cf32e547 authored by Mike Frysinger's avatar Mike Frysinger

lib: af: get_socket_for_af: re-use get_afntype

These functions are almost entirely the same, so re-use the existing
function rather than duplicate the body.
parent 86b2c777
......@@ -272,18 +272,8 @@ struct aftype *get_afntype(int af)
/* Check our protocol family table for this family and return its socket */
int get_socket_for_af(int af)
{
struct aftype **afp;
if (!sVafinit)
afinit();
afp = aftypes;
while (*afp != NULL) {
if ((*afp)->af == af)
return (*afp)->fd;
afp++;
}
return -1;
const struct aftype *afp = get_afntype(af);
return afp ? afp->fd : -1;
}
int aftrans_opt(const char *arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment