From: Keith Bostic Date: Fri, 12 Feb 1993 00:28:43 +0000 (-0800) Subject: gcc -Wall from Craig Leres (no substantive changes) X-Git-Tag: BSD-4_4-Snapshot-Development~3317 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/202d77b750600e048731e67876a62ca0cac022e1 gcc -Wall from Craig Leres (no substantive changes) SCCS-vsn: sbin/restore/dirs.c 5.27 SCCS-vsn: sbin/restore/extern.h 5.4 SCCS-vsn: sbin/restore/interactive.c 5.20 SCCS-vsn: sbin/restore/main.c 5.12 SCCS-vsn: sbin/restore/symtab.c 5.8 SCCS-vsn: sbin/restore/tape.c 5.36 --- diff --git a/usr/src/sbin/restore/dirs.c b/usr/src/sbin/restore/dirs.c index def22dec53..dbb4fd8d80 100644 --- a/usr/src/sbin/restore/dirs.c +++ b/usr/src/sbin/restore/dirs.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)dirs.c 5.26 (Berkeley) %G%"; +static char sccsid[] = "@(#)dirs.c 5.27 (Berkeley) %G%"; #endif /* not lint */ #include @@ -113,7 +113,7 @@ extractdirs(genmode) vprintf(stdout, "Extract directories from tape\n"); (void) sprintf(dirfile, "%s/rstdir%d", _PATH_TMP, dumpdate); df = fopen(dirfile, "w"); - if (df == 0) { + if (df == NULL) { fprintf(stderr, "restore: %s - cannot create directory temporary\n", dirfile); @@ -123,7 +123,7 @@ extractdirs(genmode) if (genmode != 0) { (void) sprintf(modefile, "%s/rstmode%d", _PATH_TMP, dumpdate); mf = fopen(modefile, "w"); - if (mf == 0) { + if (mf == NULL) { fprintf(stderr, "restore: %s - cannot create modefile \n", modefile); @@ -258,8 +258,9 @@ pathsearch(pathname) ino = ROOTINO; while (*path == '/') path++; + dp = NULL; while ((name = strsep(&path, "/")) != NULL && *name != NULL) { - if ((dp = searchdir(ino, name)) == 0) + if ((dp = searchdir(ino, name)) == NULL) return (NULL); ino = dp->d_ino; } @@ -281,7 +282,7 @@ searchdir(inum, name) itp = inotablookup(inum); if (itp == NULL) - return(0); + return (NULL); rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); len = strlen(name); do { @@ -488,7 +489,7 @@ rst_opendir(name) rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); return (dirp); } - return (0); + return (NULL); } /* @@ -670,7 +671,7 @@ allocinotab(ino, dip, seekpt) itp->t_ino = ino; itp->t_seekpt = seekpt; if (mf == NULL) - return(itp); + return (itp); node.ino = ino; node.timep[0].tv_sec = dip->di_atime.ts_sec; node.timep[0].tv_usec = dip->di_atime.ts_nsec / 1000; @@ -680,7 +681,7 @@ allocinotab(ino, dip, seekpt) node.uid = dip->di_uid; node.gid = dip->di_gid; (void) fwrite((char *)&node, 1, sizeof(struct modeinfo), mf); - return(itp); + return (itp); } /* @@ -694,14 +695,14 @@ inotablookup(ino) for (itp = inotab[INOHASH(ino)]; itp != NULL; itp = itp->t_next) if (itp->t_ino == ino) - return(itp); + return (itp); return (NULL); } /* * Clean up and exit */ -void +__dead void done(exitcode) int exitcode; { diff --git a/usr/src/sbin/restore/extern.h b/usr/src/sbin/restore/extern.h index 277bb4680f..3d5aca3320 100644 --- a/usr/src/sbin/restore/extern.h +++ b/usr/src/sbin/restore/extern.h @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)extern.h 5.3 (Berkeley) %G% + * @(#)extern.h 5.4 (Berkeley) %G% */ struct entry *addentry __P((char *, ino_t, int)); @@ -19,7 +19,7 @@ void createlinks __P((void)); long deletefile __P((char *, ino_t, int)); void deleteino __P((ino_t)); ino_t dirlookup __P((const char *)); -void done __P((int)); +__dead void done __P((int)); void dumpsymtable __P((char *, long)); void err __P((const char *, ...)); void extractdirs __P((int)); @@ -34,7 +34,6 @@ void getfile __P((void (*)(char *, long), void (*)(char *, long))); void getvol __P((long)); void initsymtable __P((char *)); int inodetype __P((ino_t)); -struct inotab *inotablookup __P((ino_t)); int linkit __P((char *, char *, int)); struct entry *lookupino __P((ino_t)); struct entry *lookupname __P((char *)); @@ -48,7 +47,6 @@ void newnode __P((struct entry *)); void newtapebuf __P((long)); long nodeupdates __P((char *, ino_t, int)); void onintr __P((int)); -RST_DIR *opendirfile __P((const char *)); void panic __P((const char *, ...)); void pathcheck __P((char *)); struct direct *pathsearch __P((const char *)); @@ -75,3 +73,11 @@ void treescan __P((char *, ino_t, long (*)(char *, ino_t, int))); ino_t upperbnd __P((ino_t)); long verifyfile __P((char *, ino_t, int)); void xtrnull __P((char *, long)); + +/* From ../dump/dumprmt.c */ +void rmtclose __P((void)); +int rmthost __P((char *)); +int rmtioctl __P((int, int)); +int rmtopen __P((char *, int)); +int rmtread __P((char *, int)); +int rmtseek __P((int, int)); diff --git a/usr/src/sbin/restore/interactive.c b/usr/src/sbin/restore/interactive.c index 8b10e2af89..fb57d10da6 100644 --- a/usr/src/sbin/restore/interactive.c +++ b/usr/src/sbin/restore/interactive.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)interactive.c 5.19 (Berkeley) %G%"; +static char sccsid[] = "@(#)interactive.c 5.20 (Berkeley) %G%"; #endif /* not lint */ #include @@ -55,7 +55,6 @@ struct arglist { static char *copynext __P((char *, char *)); static int fcmp __P((const void *, const void *)); -static char *fmtentry __P((struct afile *)); static void formatf __P((struct afile *, int)); static void getcmd __P((char *, char *, char *, struct arglist *)); struct dirent *glob_readdir __P((RST_DIR *dirp)); diff --git a/usr/src/sbin/restore/main.c b/usr/src/sbin/restore/main.c index b3365c2d1d..0e620c4733 100644 --- a/usr/src/sbin/restore/main.c +++ b/usr/src/sbin/restore/main.c @@ -12,7 +12,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)main.c 5.11 (Berkeley) %G%"; +static char sccsid[] = "@(#)main.c 5.12 (Berkeley) %G%"; #endif /* not lint */ #include @@ -45,7 +45,6 @@ time_t dumptime; time_t dumpdate; FILE *terminal; -static void err __P((const char *, ...)); static void obsolete __P((int *, char **[])); static void usage __P((void)); @@ -323,7 +322,7 @@ obsolete(argcp, argvp) #include #endif -void +__dead void #if __STDC__ err(const char *fmt, ...) #else diff --git a/usr/src/sbin/restore/symtab.c b/usr/src/sbin/restore/symtab.c index 002990c45d..bde57d66e6 100644 --- a/usr/src/sbin/restore/symtab.c +++ b/usr/src/sbin/restore/symtab.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)symtab.c 5.7 (Berkeley) %G%"; +static char sccsid[] = "@(#)symtab.c 5.8 (Berkeley) %G%"; #endif /* not lint */ /* @@ -149,7 +149,7 @@ lookupparent(name) char *tailindex; tailindex = rindex(name, '/'); - if (tailindex == 0) + if (tailindex == NULL) return (NULL); *tailindex = '\0'; ep = lookupname(name); diff --git a/usr/src/sbin/restore/tape.c b/usr/src/sbin/restore/tape.c index dc7af71816..5fafb6d0be 100644 --- a/usr/src/sbin/restore/tape.c +++ b/usr/src/sbin/restore/tape.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)tape.c 5.35 (Berkeley) %G%"; +static char sccsid[] = "@(#)tape.c 5.36 (Berkeley) %G%"; #endif /* not lint */ #include @@ -150,7 +150,7 @@ setup() vprintf(stdout, "Verify tape and initialize maps\n"); #ifdef RRESTORE if (host) - mt = rmtopen(magtape, O_RDONLY, 0); + mt = rmtopen(magtape, 0); else #endif if (pipein)