X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Foptr.c;h=81823a7865a0e7d26f6a9248ea87ca209c9ddbe2;hp=d1cdf1d711821d06572daae8b76b44afafe4ef61;hb=a18d599791e977f3e3d26123031e6ed4e64d6d08;hpb=2fa54f1c7aa08d2c6e0b357a35c7e22d3ca302e0 diff --git a/dump/optr.c b/dump/optr.c index d1cdf1d..81823a7 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -2,8 +2,8 @@ * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit * Remy Card , 1994-1997 - * Stelian Pop , 1999-2000 - * Stelian Pop - Alcôve , 2000 + * Stelian Pop , 1999-2000 + * Stelian Pop - Alcôve , 2000-2002 */ /*- @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: optr.c,v 1.25 2001/07/18 09:12:05 stelian Exp $"; + "$Id: optr.c,v 1.32 2002/07/19 14:57:39 stelian Exp $"; #endif /* not lint */ #include @@ -70,7 +70,6 @@ static const char rcsid[] = #include #include #include -#include #endif #include "dump.h" @@ -106,6 +105,12 @@ query(const char *question) FILE *mytty; time_t firstprompt, when_answered; + if (qflag) { + msg("%s - forced abort\n", question); + dumpabort(0); + /* NOTREACHED */ + } + firstprompt = time(NULL); if ((mytty = fopen(_PATH_TTY, "r")) == NULL) @@ -156,7 +161,7 @@ char lastmsg[BUFSIZ]; * sleep for 2 minutes in case nobody comes to satisfy dump */ static void -alarmcatch(int signo) +alarmcatch(UNUSED(int signo)) { int save_errno = errno; if (notify == 0) { @@ -184,7 +189,7 @@ alarmcatch(int signo) * Here if an inquisitive operator interrupts the dump program */ void -interrupt(int signo) +interrupt(UNUSED(int signo)) { msg("Interrupt received.\n"); if (query("Do you want to abort dump?")) @@ -280,7 +285,7 @@ static void sendmes(const char *tty, const char *message) { char t[MAXPATHLEN], buf[BUFSIZ]; - register const char *cp; + const char *cp; int lmsg = 1; FILE *f_tty; @@ -421,7 +426,7 @@ quit(fmt, va_alist) static struct fstab * allocfsent(struct fstab *fs) { - register struct fstab *new; + struct fstab *new; new = (struct fstab *)malloc(sizeof (*fs)); if (new == NULL) @@ -464,6 +469,7 @@ getfstab(void) strcmp(fs->fs_type, FSTAB_RQ)) continue; fs = allocfsent(fs); + fs->fs_passno = 0; if ((pf = (struct pfstab *)malloc(sizeof (*pf))) == NULL) quit("%s\n", strerror(errno)); pf->pf_fstab = fs; @@ -494,8 +500,8 @@ getfstab(void) struct fstab * fstabsearch(const char *key) { - register struct pfstab *pf; - register struct fstab *fs; + struct pfstab *pf; + struct fstab *fs; const char *rn; for (pf = table; pf != NULL; pf = pf->pf_next) { @@ -522,9 +528,9 @@ fstabsearch(const char *key) struct fstab * fstabsearchdir(const char *key, char *directory) { - register struct pfstab *pf; - register struct fstab *fs; - register struct fstab *found_fs = NULL; + struct pfstab *pf; + struct fstab *fs; + struct fstab *found_fs = NULL; unsigned int size = 0; struct stat buf; @@ -534,7 +540,7 @@ fstabsearchdir(const char *key, char *directory) for (pf = table; pf != NULL; pf = pf->pf_next) { fs = pf->pf_fstab; if (strlen(fs->fs_file) > size && - strlen(key) > strlen(fs->fs_file) + 1 && + strlen(key) > strlen(fs->fs_file) && strncmp(fs->fs_file, key, strlen(fs->fs_file)) == 0 && (key[strlen(fs->fs_file)] == '/' || fs->fs_file[strlen(fs->fs_file) - 1] == '/')) {