Make nfsd use setproctitle from libutil...

Old code is still #ifdef OLD_SETPROCTITLE for comparison with the old
code.
This commit is contained in:
Peter Wemm 1996-01-01 08:39:39 +00:00
parent 10dcae5806
commit c129841af7
4 changed files with 22 additions and 0 deletions

View File

@ -3,6 +3,8 @@
PROG= nfsd PROG= nfsd
CFLAGS+=-DNFS CFLAGS+=-DNFS
MAN8= nfsd.8 MAN8= nfsd.8
DPADD+= ${LIBUTIL}
LDADD+= -lutil
.if exists(${DESTDIR}/usr/lib/libkrb.a) && (defined(MAKE_KERBEROS) \ .if exists(${DESTDIR}/usr/lib/libkrb.a) && (defined(MAKE_KERBEROS) \
|| defined(MAKE_EBONES)) || defined(MAKE_EBONES))

View File

@ -81,6 +81,7 @@ static char sccsid[] = "@(#)nfsd.c 8.7 (Berkeley) 2/22/94";
#include <stdlib.h> #include <stdlib.h>
#include <strings.h> #include <strings.h>
#include <unistd.h> #include <unistd.h>
#include <libutil.h>
/* Global defs */ /* Global defs */
#ifdef DEBUG #ifdef DEBUG
@ -91,8 +92,10 @@ int debug = 0;
#endif #endif
struct nfsd_srvargs nsd; struct nfsd_srvargs nsd;
#ifdef OLD_SETPROCTITLE
char **Argv = NULL; /* pointer to argument vector */ char **Argv = NULL; /* pointer to argument vector */
char *LastArg = NULL; /* end of argv */ char *LastArg = NULL; /* end of argv */
#endif
#ifdef NFSKERB #ifdef NFSKERB
char lnam[ANAME_SZ]; char lnam[ANAME_SZ];
@ -108,9 +111,11 @@ NFSKERBKEYSCHED_T kerb_keysched;
void nonfs __P((int)); void nonfs __P((int));
void reapchild __P((int)); void reapchild __P((int));
#ifdef OLD_SETPROCTITLE
#ifdef __FreeBSD__ #ifdef __FreeBSD__
void setproctitle __P((char *)); void setproctitle __P((char *));
#endif #endif
#endif
void usage __P((void)); void usage __P((void));
/* /*
@ -167,6 +172,7 @@ main(argc, argv, envp)
} }
#endif #endif
#ifdef OLD_SETPROCTITLE
/* Save start and extent of argv for setproctitle. */ /* Save start and extent of argv for setproctitle. */
Argv = argv; Argv = argv;
if (envp == 0 || *envp == 0) if (envp == 0 || *envp == 0)
@ -174,6 +180,7 @@ main(argc, argv, envp)
while (*envp) while (*envp)
envp++; envp++;
LastArg = envp[-1] + strlen(envp[-1]); LastArg = envp[-1] + strlen(envp[-1]);
#endif
#define MAXNFSDCNT 20 #define MAXNFSDCNT 20
#define DEFNFSDCNT 4 #define DEFNFSDCNT 4
@ -643,6 +650,7 @@ reapchild(signo)
while (wait3(NULL, WNOHANG, NULL) > 0); while (wait3(NULL, WNOHANG, NULL) > 0);
} }
#ifdef OLD_SETPROCTITLE
#ifdef __FreeBSD__ #ifdef __FreeBSD__
void void
setproctitle(a) setproctitle(a)
@ -660,3 +668,4 @@ setproctitle(a)
Argv[1] = NULL; Argv[1] = NULL;
} }
#endif /* __FreeBSD__ */ #endif /* __FreeBSD__ */
#endif

View File

@ -3,6 +3,8 @@
PROG= nfsd PROG= nfsd
CFLAGS+=-DNFS CFLAGS+=-DNFS
MAN8= nfsd.8 MAN8= nfsd.8
DPADD+= ${LIBUTIL}
LDADD+= -lutil
.if exists(${DESTDIR}/usr/lib/libkrb.a) && (defined(MAKE_KERBEROS) \ .if exists(${DESTDIR}/usr/lib/libkrb.a) && (defined(MAKE_KERBEROS) \
|| defined(MAKE_EBONES)) || defined(MAKE_EBONES))

View File

@ -81,6 +81,7 @@ static char sccsid[] = "@(#)nfsd.c 8.7 (Berkeley) 2/22/94";
#include <stdlib.h> #include <stdlib.h>
#include <strings.h> #include <strings.h>
#include <unistd.h> #include <unistd.h>
#include <libutil.h>
/* Global defs */ /* Global defs */
#ifdef DEBUG #ifdef DEBUG
@ -91,8 +92,10 @@ int debug = 0;
#endif #endif
struct nfsd_srvargs nsd; struct nfsd_srvargs nsd;
#ifdef OLD_SETPROCTITLE
char **Argv = NULL; /* pointer to argument vector */ char **Argv = NULL; /* pointer to argument vector */
char *LastArg = NULL; /* end of argv */ char *LastArg = NULL; /* end of argv */
#endif
#ifdef NFSKERB #ifdef NFSKERB
char lnam[ANAME_SZ]; char lnam[ANAME_SZ];
@ -108,9 +111,11 @@ NFSKERBKEYSCHED_T kerb_keysched;
void nonfs __P((int)); void nonfs __P((int));
void reapchild __P((int)); void reapchild __P((int));
#ifdef OLD_SETPROCTITLE
#ifdef __FreeBSD__ #ifdef __FreeBSD__
void setproctitle __P((char *)); void setproctitle __P((char *));
#endif #endif
#endif
void usage __P((void)); void usage __P((void));
/* /*
@ -167,6 +172,7 @@ main(argc, argv, envp)
} }
#endif #endif
#ifdef OLD_SETPROCTITLE
/* Save start and extent of argv for setproctitle. */ /* Save start and extent of argv for setproctitle. */
Argv = argv; Argv = argv;
if (envp == 0 || *envp == 0) if (envp == 0 || *envp == 0)
@ -174,6 +180,7 @@ main(argc, argv, envp)
while (*envp) while (*envp)
envp++; envp++;
LastArg = envp[-1] + strlen(envp[-1]); LastArg = envp[-1] + strlen(envp[-1]);
#endif
#define MAXNFSDCNT 20 #define MAXNFSDCNT 20
#define DEFNFSDCNT 4 #define DEFNFSDCNT 4
@ -643,6 +650,7 @@ reapchild(signo)
while (wait3(NULL, WNOHANG, NULL) > 0); while (wait3(NULL, WNOHANG, NULL) > 0);
} }
#ifdef OLD_SETPROCTITLE
#ifdef __FreeBSD__ #ifdef __FreeBSD__
void void
setproctitle(a) setproctitle(a)
@ -660,3 +668,4 @@ setproctitle(a)
Argv[1] = NULL; Argv[1] = NULL;
} }
#endif /* __FreeBSD__ */ #endif /* __FreeBSD__ */
#endif