* Ported to Linux's Second Extended File System as part of the
* dump and restore backup suit
* Remy Card <card@Linux.EU.Org>, 1994-1997
- * Stelian Pop <pop@noos.fr>, 1999-2000
- * Stelian Pop <pop@noos.fr> - Alcôve <www.alcove.fr>, 2000
+ * Stelian Pop <stelian@popies.net>, 1999-2000
+ * Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
*/
/*-
#ifndef lint
static const char rcsid[] =
- "$Id: optr.c,v 1.24 2001/06/18 11:07:45 stelian Exp $";
+ "$Id: optr.c,v 1.32 2002/07/19 14:57:39 stelian Exp $";
#endif /* not lint */
#include <config.h>
#include <sys/param.h>
#include <sys/wait.h>
#include <sys/time.h>
+#include <time.h>
#include <errno.h>
#include <fstab.h>
#include <ext2fs/ext2fs.h>
#include <bsdcompat.h>
#include <signal.h>
-#include <time.h>
#endif
#include "dump.h"
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)
* 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) {
* 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?"))
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;
static struct fstab *
allocfsent(struct fstab *fs)
{
- register struct fstab *new;
+ struct fstab *new;
new = (struct fstab *)malloc(sizeof (*fs));
if (new == NULL)
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;
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) {
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;
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] == '/')) {