diff options
author | wpaul <wpaul@FreeBSD.org> | 1995-07-25 22:44:14 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1995-07-25 22:44:14 +0000 |
commit | ead9dfe985f4da7c14ccb9df469bbbd336420f75 (patch) | |
tree | d810dd8971d45be51b021f6256b9cea7e6176c75 /usr.sbin/bootparamd | |
parent | 3055a59ca7d155763f9838052f32a1da6df3235a (diff) | |
download | FreeBSD-src-ead9dfe985f4da7c14ccb9df469bbbd336420f75.zip FreeBSD-src-ead9dfe985f4da7c14ccb9df469bbbd336420f75.tar.gz |
main.c:
- use daemon() to daemonify ourselves
- the 'Usage' printf() was missing an argument
- remove declaration of rindex and #include <string.h> instead
bootparam.c:
- get rid of local declarations of YP functions and include headers
from /usr/include/rpcsvc instead.
Diffstat (limited to 'usr.sbin/bootparamd')
-rw-r--r-- | usr.sbin/bootparamd/bootparamd/bootparamd.c | 8 | ||||
-rw-r--r-- | usr.sbin/bootparamd/bootparamd/main.c | 25 |
2 files changed, 9 insertions, 24 deletions
diff --git a/usr.sbin/bootparamd/bootparamd/bootparamd.c b/usr.sbin/bootparamd/bootparamd/bootparamd.c index ed088be..02c2f67 100644 --- a/usr.sbin/bootparamd/bootparamd/bootparamd.c +++ b/usr.sbin/bootparamd/bootparamd/bootparamd.c @@ -5,12 +5,14 @@ use and modify. Please send modifications and/or suggestions + bug fixes to Klas Heggemann <klas@nada.kth.se> - $Id: bootparamd.c,v 1.1.1.1 1995/02/26 23:40:52 wpaul Exp $ + $Id: bootparamd.c,v 1.2 1995/05/30 03:46:27 rgrimes Exp $ */ #include <rpc/rpc.h> +#include <rpcsvc/yp_prot.h> +#include <rpcsvc/ypclnt.h> #include "bootparam_prot.h" #include <stdio.h> #include <sys/types.h> @@ -174,8 +176,6 @@ char *fileid, *buffer; char *where; static char *result; int resultlen; - extern int yp_get_default_domain(); - extern int yp_match(); static char *yp_domain; int ch, pch, fid_len, res = 0; @@ -271,8 +271,6 @@ char *hostname; int res = 0; static char *result; int resultlen; - extern int yp_get_default_domain(); - extern int yp_match(); static char *yp_domain; /* struct hostent *cmp_he;*/ diff --git a/usr.sbin/bootparamd/bootparamd/main.c b/usr.sbin/bootparamd/bootparamd/main.c index 1e3d30f..b8d8629 100644 --- a/usr.sbin/bootparamd/bootparamd/main.c +++ b/usr.sbin/bootparamd/bootparamd/main.c @@ -6,12 +6,13 @@ use and modify. Please send modifications and/or suggestions + bug fixes to Klas Heggemann <klas@nada.kth.se> - $Id: main.c,v 1.1.1.1 1995/02/26 23:40:52 wpaul Exp $ + $Id: main.c,v 1.2 1995/05/30 03:46:28 rgrimes Exp $ */ -#include <syslog.h> #include <stdio.h> +#include <string.h> +#include <syslog.h> #include <sys/ioctl.h> #include <rpc/rpc.h> #include "bootparam_prot.h" @@ -38,8 +39,7 @@ int argc; char **argv; { SVCXPRT *transp; - int i,s, pid; - char *rindex(); + int i; struct hostent *he; struct stat buf; char *optstring; @@ -82,7 +82,7 @@ char **argv; break; default: fprintf(stderr, - "Usage: %s [-d ] [ -s ] [ -r router ] [ -f bootparmsfile ]\n"); + "Usage: %s [-d ] [ -s ] [ -r router ] [ -f bootparmsfile ]\n", progname); exit(1); } @@ -99,23 +99,10 @@ char **argv; } if (!debug) { - pid = fork(); - if ( pid < 0) { + if (daemon(0,0)) { perror("bootparamd: fork"); exit(1); } - if (pid) exit(0); /* parent */ - - /* child */ - for ( s = 0; s < 20 ; s++) close(s); - open("/", 0); - dup2(0, 1); - dup2(0, 2); - s = open("/dev/tty",2); - if ( s >= 0 ) { - ioctl(s, TIOCNOTTY, 0); - close(s); - } } |