doesn't core when nfsserver support is not in kernel
This commit is contained in:
parent
f5b725b323
commit
cf30e49568
@ -42,7 +42,7 @@ char copyright[] =
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char sccsid[] = "@(#)nfsd.c 5.10 (Berkeley) 4/24/91";
|
static char sccsid[] = "@(#)nfsd.c 5.10 (Berkeley) 4/24/91";
|
||||||
static char rcsid[] = "$Header: /cvsroot/src/sbin/nfsd/Attic/nfsd.c,v 1.3 1993/03/23 00:29:32 cgd Exp $";
|
static char rcsid[] = "$Header: /cvsroot/src/sbin/nfsd/Attic/nfsd.c,v 1.4 1993/04/10 20:16:04 glass Exp $";
|
||||||
#endif not lint
|
#endif not lint
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -78,7 +78,7 @@ struct hadr {
|
|||||||
struct hadr hphead;
|
struct hadr hphead;
|
||||||
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 */
|
||||||
void reapchild();
|
void reapchild(),not_nfsserver();;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Nfs server daemon mostly just a user context for nfssvc()
|
* Nfs server daemon mostly just a user context for nfssvc()
|
||||||
@ -200,7 +200,7 @@ main(argc, argv, envp)
|
|||||||
signal(SIGHUP, SIG_IGN);
|
signal(SIGHUP, SIG_IGN);
|
||||||
}
|
}
|
||||||
signal(SIGCHLD, reapchild);
|
signal(SIGCHLD, reapchild);
|
||||||
|
signal(SIGSYS, not_nfsserver);
|
||||||
if (reregister) {
|
if (reregister) {
|
||||||
if (udpflag && !pmap_set(RPCPROG_NFS, NFS_VER2, IPPROTO_UDP,
|
if (udpflag && !pmap_set(RPCPROG_NFS, NFS_VER2, IPPROTO_UDP,
|
||||||
NFS_PORT)) {
|
NFS_PORT)) {
|
||||||
@ -361,3 +361,9 @@ setproctitle(a, sin)
|
|||||||
while (cp < LastArg)
|
while (cp < LastArg)
|
||||||
*cp++ = ' ';
|
*cp++ = ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void not_nfsserver()
|
||||||
|
{
|
||||||
|
(void) fprintf(stderr, "nfsd: not configured as NFS server\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
@ -42,7 +42,7 @@ char copyright[] =
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char sccsid[] = "@(#)nfsd.c 5.10 (Berkeley) 4/24/91";
|
static char sccsid[] = "@(#)nfsd.c 5.10 (Berkeley) 4/24/91";
|
||||||
static char rcsid[] = "$Header: /cvsroot/src/usr.sbin/nfsd/nfsd.c,v 1.3 1993/03/23 00:29:32 cgd Exp $";
|
static char rcsid[] = "$Header: /cvsroot/src/usr.sbin/nfsd/nfsd.c,v 1.4 1993/04/10 20:16:04 glass Exp $";
|
||||||
#endif not lint
|
#endif not lint
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -78,7 +78,7 @@ struct hadr {
|
|||||||
struct hadr hphead;
|
struct hadr hphead;
|
||||||
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 */
|
||||||
void reapchild();
|
void reapchild(),not_nfsserver();;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Nfs server daemon mostly just a user context for nfssvc()
|
* Nfs server daemon mostly just a user context for nfssvc()
|
||||||
@ -200,7 +200,7 @@ main(argc, argv, envp)
|
|||||||
signal(SIGHUP, SIG_IGN);
|
signal(SIGHUP, SIG_IGN);
|
||||||
}
|
}
|
||||||
signal(SIGCHLD, reapchild);
|
signal(SIGCHLD, reapchild);
|
||||||
|
signal(SIGSYS, not_nfsserver);
|
||||||
if (reregister) {
|
if (reregister) {
|
||||||
if (udpflag && !pmap_set(RPCPROG_NFS, NFS_VER2, IPPROTO_UDP,
|
if (udpflag && !pmap_set(RPCPROG_NFS, NFS_VER2, IPPROTO_UDP,
|
||||||
NFS_PORT)) {
|
NFS_PORT)) {
|
||||||
@ -361,3 +361,9 @@ setproctitle(a, sin)
|
|||||||
while (cp < LastArg)
|
while (cp < LastArg)
|
||||||
*cp++ = ' ';
|
*cp++ = ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void not_nfsserver()
|
||||||
|
{
|
||||||
|
(void) fprintf(stderr, "nfsd: not configured as NFS server\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user