PERFORCE change 79592 for review
soc-bushman
soc-bushman at FreeBSD.org
Tue Jul 5 10:31:05 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=79592
Change 79592 by soc-bushman at soc-bushman_stinger on 2005/07/05 10:30:51
some cleanups and some small bugfixes
Affected files ...
.. //depot/projects/soc2005/nsswitch_cached/src/lib/libc/net/getservbyname.c#5 edit
.. //depot/projects/soc2005/nsswitch_cached/src/lib/libc/net/getservbyport.c#5 edit
.. //depot/projects/soc2005/nsswitch_cached/src/lib/libc/net/getservent.c#7 edit
Differences ...
==== //depot/projects/soc2005/nsswitch_cached/src/lib/libc/net/getservbyname.c#5 (text+ko) ====
@@ -36,55 +36,3 @@
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/lib/libc/net/getservbyname.c,v 1.7 2005/04/18 18:34:58 ume Exp $");
-
-/*#include <netdb.h>
-#include <string.h>
-#include "netdb_private.h"
-
-int
-getservbyname_r(const char *name, const char *proto, struct servent *se,
- struct servent_data *sed)
-{
- char **cp;
- int error;
-
-#ifdef YP
- sed->yp_name = (char *)name;
- sed->yp_proto = (char *)proto;
-#endif
-
- setservent_r(sed->stayopen, sed);
- while ((error = getservent_r(se, sed)) == 0) {
- if (strcmp(name, se->s_name) == 0)
- goto gotname;
- for (cp = se->s_aliases; *cp; cp++)
- if (strcmp(name, *cp) == 0)
- goto gotname;
- continue;
-gotname:
- if (proto == 0 || strcmp(se->s_proto, proto) == 0)
- break;
- }
- if (!sed->stayopen)
- endservent_r(sed);
-
-#ifdef YP
- sed->yp_name = NULL;
- sed->yp_proto = NULL;
-#endif
-
- return (error);
-}
-
-struct servent *
-getservbyname(const char *name, const char *proto)
-{
- struct servdata *sd;
-
- if ((sd = __servdata_init()) == NULL)
- return (NULL);
- if (getservbyname_r(name, proto, &sd->serv, &sd->data) != 0)
- return (NULL);
- return (&sd->serv);
-}
-*/
==== //depot/projects/soc2005/nsswitch_cached/src/lib/libc/net/getservbyport.c#5 (text+ko) ====
@@ -36,50 +36,3 @@
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/lib/libc/net/getservbyport.c,v 1.7 2005/04/18 18:34:58 ume Exp $");
-
-/*
-#include <netdb.h>
-#include <string.h>
-#include "netdb_private.h"
-
-int
-getservbyport_r(int port, const char *proto, struct servent *se,
- struct servent_data *sed)
-{
- int error;
-
-#ifdef YP
- sed->yp_port = port;
- sed->yp_proto = (char *)proto;
-#endif
-
- setservent_r(sed->stayopen, sed);
- while ((error = getservent_r(se, sed)) == 0) {
- if (se->s_port != port)
- continue;
- if (proto == 0 || strcmp(se->s_proto, proto) == 0)
- break;
- }
- if (!sed->stayopen)
- endservent_r(sed);
-
-#ifdef YP
- sed->yp_port = 0;
- sed->yp_proto = NULL;
-#endif
-
- return (error);
-}
-
-struct servent *
-getservbyport(int port, const char *proto)
-{
- struct servdata *sd;
-
- if ((sd = __servdata_init()) == NULL)
- return (NULL);
- if (getservbyport_r(port, proto, &sd->serv, &sd->data) != 0)
- return (NULL);
- return (&sd->serv);
-}
-*/
==== //depot/projects/soc2005/nsswitch_cached/src/lib/libc/net/getservent.c#7 (text+ko) ====
@@ -308,9 +308,10 @@
break;
}
- if (*line=='+')
- st->compat_mode_active = 1;
- else {
+ if (*line=='+') {
+ if (serv_mdata->compat_mode != 0)
+ st->compat_mode_active = 1;
+ } else {
if (bufsize <= linesize + _ALIGNBYTES + sizeof(char *)) {
*errnop = ERANGE;
rv = NS_RETURN;
@@ -340,7 +341,7 @@
compat_src, port, proto, serv, buffer, bufsize, errnop);
break;
case nss_lt_all:
- rv = nsdispatch(retval, compat_dtab, NSDB_SERVICES, "getservent_r",
+ rv = nsdispatch(retval, compat_dtab, NSDB_SERVICES_COMPAT, "getservent_r",
compat_src, serv, buffer, bufsize, errnop);
break;
}
More information about the p4-projects
mailing list