summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.ypupdated/update.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-02-06 15:26:07 +0000
committerdes <des@FreeBSD.org>2002-02-06 15:26:07 +0000
commitd7b064e238d98e1c9942cfb6e53c0767893310b1 (patch)
tree9c2a46d61c0b1ec2538854e870b6861acfd2ee7a /usr.sbin/rpc.ypupdated/update.c
parent0f2cb9b020b907000a28323fc57a82fdb7d6626d (diff)
downloadFreeBSD-src-d7b064e238d98e1c9942cfb6e53c0767893310b1.zip
FreeBSD-src-d7b064e238d98e1c9942cfb6e53c0767893310b1.tar.gz
ANSIfy and remove some dead code.
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'usr.sbin/rpc.ypupdated/update.c')
-rw-r--r--usr.sbin/rpc.ypupdated/update.c54
1 files changed, 11 insertions, 43 deletions
diff --git a/usr.sbin/rpc.ypupdated/update.c b/usr.sbin/rpc.ypupdated/update.c
index 6566f46..5cc0d7a 100644
--- a/usr.sbin/rpc.ypupdated/update.c
+++ b/usr.sbin/rpc.ypupdated/update.c
@@ -85,14 +85,9 @@ static int _openchild(char *, FILE **, FILE **);
* and update it if so. Returns the yp status, which is zero
* if there is no access violation.
*/
-mapupdate(requester, mapname, op, keylen, key, datalen, data)
- char *requester;
- char *mapname;
- u_int op;
- u_int keylen;
- char *key;
- u_int datalen;
- char *data;
+int
+mapupdate(char *requester, char *mapname, u_int op, u_int keylen, char *key,
+ u_int datalen, char *data)
{
char updater[MAXMAPNAMELEN + 40];
FILE *childargs;
@@ -137,23 +132,19 @@ mapupdate(requester, mapname, op, keylen, key, datalen, data)
(void)wait(&status);
#ifdef WEXITSTATUS
- if (WEXITSTATUS(status) != 0) {
+ if (WEXITSTATUS(status) != 0)
#else
- if (status.w_retcode != 0) {
+ if (status.w_retcode != 0)
#endif
return (YPERR_YPERR);
- }
return (yperrno);
}
/*
* returns pid, or -1 for failure
*/
-static
-_openchild(command, fto, ffrom)
- char *command;
- FILE **fto;
- FILE **ffrom;
+static int
+_openchild(char *command, FILE **fto, FILE **ffrom)
{
int i;
pid_t pid;
@@ -168,11 +159,7 @@ _openchild(command, fto, ffrom)
if (pipe(pdfrom) < 0) {
goto error2;
}
-#ifdef VFORK
- switch (pid = vfork()) {
-#else
switch (pid = fork()) {
-#endif
case -1:
goto error3;
@@ -222,8 +209,7 @@ error1:
}
static char *
-basename(path)
- char *path;
+basename(char *path)
{
char *p;
@@ -237,16 +223,6 @@ basename(path)
#else /* YP */
-#ifdef foo
-#define ERR_ACCESS 1
-#define ERR_MALLOC 2
-#define ERR_READ 3
-#define ERR_WRITE 4
-#define ERR_DBASE 5
-#define ERR_KEY 6
-extern char *malloc();
-#endif
-
static int match(char *, char *);
/*
@@ -256,14 +232,8 @@ static int match(char *, char *);
* the local file and then shuts up.
*/
int
-localupdate(name, filename, op, keylen, key, datalen, data)
- char *name; /* Name of the requestor */
- char *filename;
- u_int op;
- u_int keylen; /* Not used */
- char *key;
- u_int datalen; /* Not used */
- char *data;
+localupdate(char *name, char *filename, u_int op, u_int keylen __unused,
+ char *key, u_int datalen __unused, char *data)
{
char line[256];
FILE *rf;
@@ -349,9 +319,7 @@ localupdate(name, filename, op, keylen, key, datalen, data)
}
static int
-match(line, name)
- char *line;
- char *name;
+match(char *line, char *name)
{
int len;
OpenPOWER on IntegriCloud