new copyright notice
[unix-history] / usr / src / lib / libc / net / getservent.c
index 49a47cb..8ba5271 100644 (file)
@@ -1,12 +1,13 @@
 /*
  * Copyright (c) 1983 Regents of the University of California.
 /*
  * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservent.c       5.4 (Berkeley) %G%";
-#endif LIBC_SCCS and not lint
+static char sccsid[] = "@(#)getservent.c       5.8 (Berkeley) %G%";
+#endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
 #include <sys/param.h>
 
 #include <stdio.h>
 #include <sys/param.h>
@@ -17,7 +18,6 @@ static char sccsid[] = "@(#)getservent.c      5.4 (Berkeley) %G%";
 
 #define        MAXALIASES      35
 
 
 #define        MAXALIASES      35
 
-static char SERVDB[] = "/etc/services";
 static FILE *servf = NULL;
 static char line[BUFSIZ+1];
 static struct servent serv;
 static FILE *servf = NULL;
 static char line[BUFSIZ+1];
 static struct servent serv;
@@ -29,7 +29,7 @@ setservent(f)
        int f;
 {
        if (servf == NULL)
        int f;
 {
        if (servf == NULL)
-               servf = fopen(SERVDB, "r" );
+               servf = fopen(_PATH_SERVICES, "r" );
        else
                rewind(servf);
        _serv_stayopen |= f;
        else
                rewind(servf);
        _serv_stayopen |= f;
@@ -50,7 +50,7 @@ getservent()
        char *p;
        register char *cp, **q;
 
        char *p;
        register char *cp, **q;
 
-       if (servf == NULL && (servf = fopen(SERVDB, "r" )) == NULL)
+       if (servf == NULL && (servf = fopen(_PATH_SERVICES, "r" )) == NULL)
                return (NULL);
 again:
        if ((p = fgets(line, BUFSIZ, servf)) == NULL)
                return (NULL);
 again:
        if ((p = fgets(line, BUFSIZ, servf)) == NULL)