version 1.6, 1997/07/22 06:59:38 |
version 1.7, 1998/06/26 21:21:09 |
|
|
*/ |
*/ |
|
|
#ifndef lint |
#ifndef lint |
|
#if 0 |
static char RCSid[] = |
static char RCSid[] = |
|
"$From: docmd.c,v 6.86 1996/01/30 02:29:43 mcooper Exp $"; |
|
#else |
|
static char RCSid[] = |
"$OpenBSD$"; |
"$OpenBSD$"; |
|
#endif |
|
|
static char sccsid[] = "@(#)docmd.c 5.1 (Berkeley) 6/6/85"; |
static char sccsid[] = "@(#)docmd.c 5.1 (Berkeley) 6/6/85"; |
|
|
|
|
char *rhost; |
char *rhost; |
int didupdate = 0; |
int didupdate = 0; |
|
|
|
#ifdef __GNUC__ |
|
(void)&didupdate; |
|
(void)&opts; |
|
#endif |
|
|
if (setjmp_ok) { |
if (setjmp_ok) { |
error("reentrant call to doarrow"); |
error("reentrant call to doarrow"); |
abort(); |
abort(); |
|
|
setjmp_ok = FALSE; |
setjmp_ok = FALSE; |
} |
} |
|
|
|
int |
okname(name) |
okname(name) |
register char *name; |
register char *name; |
{ |
{ |
|
|
} |
} |
optarget = ptarget; |
optarget = ptarget; |
len = ptarget - target; |
len = ptarget - target; |
while (dp = readdir(d)) { |
while ((dp = readdir(d))) { |
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) |
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) |
continue; |
continue; |
if (len + 1 + (int)strlen(dp->d_name) >= BUFSIZ - 1) { |
if (len + 1 + (int)strlen(dp->d_name) >= BUFSIZ - 1) { |
|
|
ptarget = optarget; |
ptarget = optarget; |
*ptarget++ = '/'; |
*ptarget++ = '/'; |
cp = dp->d_name; |
cp = dp->d_name; |
while (*ptarget++ = *cp++) |
while ((*ptarget++ = *cp++)) |
; |
; |
ptarget--; |
ptarget--; |
cmptime(target, sbcmds, env); |
cmptime(target, sbcmds, env); |
|
|
|
|
for (sc = sbcmds; sc != NULL; sc = sc->sc_next) { |
for (sc = sbcmds; sc != NULL; sc = sc->sc_next) { |
if (sc->sc_type == NOTIFY) |
if (sc->sc_type == NOTIFY) |
notify((char *)NULL, sc->sc_args, (time_t)lastmod); |
notify(NULL, sc->sc_args, (time_t)lastmod); |
else if (sc->sc_type == CMDSPECIAL && env) { |
else if (sc->sc_type == CMDSPECIAL && env) { |
char *p; |
char *p; |
int len = strlen(env); |
int len = strlen(env); |
|
|
|
|
if (!nflag) { |
if (!nflag) { |
currenthost = (cmd->c_name) ? cmd->c_name : "<unknown>"; |
currenthost = (cmd->c_name) ? cmd->c_name : "<unknown>"; |
#if defined(SETARGS) |
#if defined(SETARGS) || defined(HAVE_SETPROCTITLE) |
setproctitle("update %s", currenthost); |
setproctitle("update %s", currenthost); |
#endif /* SETARGS */ |
#endif /* SETARGS || HAVE_SETPROCTITLE */ |
} |
} |
|
|
switch (cmd->c_type) { |
switch (cmd->c_type) { |
|
|
for (i = 0; i < argc; i++) { |
for (i = 0; i < argc; i++) { |
if (cmd->c_label != NULL && |
if (cmd->c_label != NULL && |
strcmp(cmd->c_label, argv[i]) == 0) { |
strcmp(cmd->c_label, argv[i]) == 0) { |
docmdhost(cmd, (char **) NULL); |
docmdhost(cmd, NULL); |
return; |
return; |
} |
} |
for (f = cmd->c_files; f != NULL; f = f->n_next) |
for (f = cmd->c_files; f != NULL; f = f->n_next) |
|
|
} |
} |
} |
} |
} else |
} else |
docmdhost(cmd, (char **) NULL); |
docmdhost(cmd, NULL); |
} |
} |
|
|
/* |
/* |