diff options
Diffstat (limited to 'lib/libc/net/getservbyport.c')
-rw-r--r-- | lib/libc/net/getservbyport.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libc/net/getservbyport.c b/lib/libc/net/getservbyport.c index 0acb31b..ef9a2e8 100644 --- a/lib/libc/net/getservbyport.c +++ b/lib/libc/net/getservbyport.c @@ -47,8 +47,16 @@ getservbyport(port, proto) { register struct servent *p; +#ifdef YP + extern int ___getservbyport_yp; + extern char *___getservbyproto_yp; + + ___getservbyport_yp = port; + ___getservbyproto_yp = (char *)proto; +#endif + setservent(_serv_stayopen); - while (p = getservent()) { + while ( (p = getservent()) ) { if (p->s_port != port) continue; if (proto == 0 || strcmp(p->s_proto, proto) == 0) @@ -56,5 +64,11 @@ getservbyport(port, proto) } if (!_serv_stayopen) endservent(); + +#ifdef YP + ___getservbyport_yp = 0; + ___getservbyproto_yp = NULL; +#endif + return (p); } |