Avoid confict with reserved identifier "log".

This commit is contained in:
thorpej 2002-12-06 03:09:28 +00:00
parent e0e584cdfa
commit f393397bd6
3 changed files with 24 additions and 23 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.14 2002/06/14 01:18:54 wiz Exp $ */
/* $NetBSD: defs.h,v 1.15 2002/12/06 03:09:28 thorpej Exp $ */
/*
* Copyright (c) 1983, 1993
@ -170,7 +170,7 @@ int inlist(struct namelist *, char *);
void insert(char *,
struct namelist *, struct namelist *, struct subcmd *);
void install(char *, char *, int, int);
void log(FILE *, const char *, ...)
void dolog(FILE *, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
struct namelist *
lookup(char *, int, struct namelist *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: docmd.c,v 1.21 2002/06/14 01:18:54 wiz Exp $ */
/* $NetBSD: docmd.c,v 1.22 2002/12/06 03:09:28 thorpej Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)docmd.c 8.1 (Berkeley) 6/9/93";
#else
__RCSID("$NetBSD: docmd.c,v 1.21 2002/06/14 01:18:54 wiz Exp $");
__RCSID("$NetBSD: docmd.c,v 1.22 2002/12/06 03:09:28 thorpej Exp $");
#endif
#endif /* not lint */
@ -201,7 +201,7 @@ done:
if ((opts & IGNLNKS) || ihead->count == 0)
continue;
if (lfp)
log(lfp, "%s: Warning: missing links\n",
dolog(lfp, "%s: Warning: missing links\n",
ihead->pathname);
}
}
@ -337,7 +337,7 @@ lostconn(int signo)
if (iamremote)
cleanup(0);
if (lfp)
log(lfp, "rdist: %s\n", buf);
dolog(lfp, "rdist: %s\n", buf);
else
error("%s\n", buf);
longjmp(env, 1);
@ -474,7 +474,7 @@ cmptime(char *name)
}
if (stb.st_mtime > lastmod)
log(tfp, "new: %s\n", name);
dolog(tfp, "new: %s\n", name);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: server.c,v 1.23 2002/06/14 01:18:55 wiz Exp $ */
/* $NetBSD: server.c,v 1.24 2002/12/06 03:09:28 thorpej Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)server.c 8.1 (Berkeley) 6/9/93";
#else
__RCSID("$NetBSD: server.c,v 1.23 2002/06/14 01:18:55 wiz Exp $");
__RCSID("$NetBSD: server.c,v 1.24 2002/12/06 03:09:28 thorpej Exp $");
#endif
#endif /* not lint */
@ -344,7 +344,7 @@ sendf(char *rname, int opts)
if (pw == NULL || pw->pw_uid != stb.st_uid)
if ((pw = getpwuid(stb.st_uid)) == NULL) {
log(lfp, "%s: no password entry for uid %d \n",
dolog(lfp, "%s: no password entry for uid %d \n",
target, stb.st_uid);
pw = NULL;
(void)snprintf(user, sizeof(user), ":%lu",
@ -352,7 +352,7 @@ sendf(char *rname, int opts)
}
if (gr == NULL || gr->gr_gid != stb.st_gid)
if ((gr = getgrgid(stb.st_gid)) == NULL) {
log(lfp, "%s: no name for group %d\n",
dolog(lfp, "%s: no name for group %d\n",
target, stb.st_gid);
gr = NULL;
(void)snprintf(group, sizeof(group), ":%lu",
@ -360,10 +360,10 @@ sendf(char *rname, int opts)
}
if (u == 1) {
if (opts & VERIFY) {
log(lfp, "need to install: %s\n", target);
dolog(lfp, "need to install: %s\n", target);
goto dospecial;
}
log(lfp, "installing: %s\n", target);
dolog(lfp, "installing: %s\n", target);
opts &= ~(COMPARE|REMOVE);
}
@ -470,10 +470,10 @@ sendf(char *rname, int opts)
if (u == 2) {
if (opts & VERIFY) {
log(lfp, "need to update: %s\n", target);
dolog(lfp, "need to update: %s\n", target);
goto dospecial;
}
log(lfp, "updating: %s\n", target);
dolog(lfp, "updating: %s\n", target);
}
if (stb.st_nlink > 1) {
@ -538,7 +538,7 @@ dospecial:
continue;
if (sc->sc_args != NULL && !inlist(sc->sc_args, target))
continue;
log(lfp, "special \"%s\"\n", sc->sc_name);
dolog(lfp, "special \"%s\"\n", sc->sc_name);
if (opts & VERIFY)
continue;
(void) snprintf(buf, sizeof(buf), "SFILE=%s;%s\n", target,
@ -564,7 +564,7 @@ savelink(struct stat *stp)
}
lp = (struct linkbuf *) malloc(sizeof(*lp));
if (lp == NULL)
log(lfp, "out of memory, link information lost\n");
dolog(lfp, "out of memory, link information lost\n");
else {
lp->nextp = ihead;
ihead = lp;
@ -632,7 +632,7 @@ again:
case '\3':
*--cp = '\0';
if (lfp != NULL)
log(lfp, "update: note: %s\n", s);
dolog(lfp, "update: note: %s\n", s);
goto again;
default:
@ -668,7 +668,8 @@ again:
if (stp->st_mtime == mtime)
return(0);
if (stp->st_mtime < mtime) {
log(lfp, "Warning: %s: remote copy is newer\n", target);
dolog(lfp, "Warning: %s: remote copy is newer\n",
target);
return(0);
}
} else if (stp->st_mtime == mtime && stp->st_size == size)
@ -1168,7 +1169,7 @@ rmchk(int opts)
case '\0':
*--cp = '\0';
if (*s != '\0')
log(lfp, "%s\n", s);
dolog(lfp, "%s\n", s);
break;
case 'E':
@ -1411,7 +1412,7 @@ dospecial(char *cmd)
void
log(FILE *fp, const char *fmt, ...)
dolog(FILE *fp, const char *fmt, ...)
{
va_list ap;
@ -1512,13 +1513,13 @@ response(void)
case '\0':
*--cp = '\0';
if (*s != '\0') {
log(lfp, "%s\n", s);
dolog(lfp, "%s\n", s);
return(1);
}
return(0);
case '\3':
*--cp = '\0';
log(lfp, "Note: %s\n",s);
dolog(lfp, "Note: %s\n",s);
return(response());
default: