gcc -Wall from Craig Leres (no substantive changes)
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 12 Feb 1993 00:28:43 +0000 (16:28 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 12 Feb 1993 00:28:43 +0000 (16:28 -0800)
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

usr/src/sbin/restore/dirs.c
usr/src/sbin/restore/extern.h
usr/src/sbin/restore/interactive.c
usr/src/sbin/restore/main.c
usr/src/sbin/restore/symtab.c
usr/src/sbin/restore/tape.c

index def22de..dbb4fd8 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dirs.c     5.26 (Berkeley) %G%";
+static char sccsid[] = "@(#)dirs.c     5.27 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -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");
        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);
                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 (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);
                        fprintf(stderr,
                            "restore: %s - cannot create modefile \n",
                            modefile);
@@ -258,8 +258,9 @@ pathsearch(pathname)
        ino = ROOTINO;
        while (*path == '/')
                path++;
        ino = ROOTINO;
        while (*path == '/')
                path++;
+       dp = NULL;
        while ((name = strsep(&path, "/")) != NULL && *name != 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;
        }
                        return (NULL);
                ino = dp->d_ino;
        }
@@ -281,7 +282,7 @@ searchdir(inum, name)
 
        itp = inotablookup(inum);
        if (itp == NULL)
 
        itp = inotablookup(inum);
        if (itp == NULL)
-               return(0);
+               return (NULL);
        rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
        len = strlen(name);
        do {
        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);
        }
                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)
        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;
        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);
        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)
 
        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
  */
        return (NULL);
 }
 
 /*
  * Clean up and exit
  */
-void
+__dead void
 done(exitcode)
        int exitcode;
 {
 done(exitcode)
        int exitcode;
 {
index 277bb46..3d5aca3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)extern.h    5.3 (Berkeley) %G%
+ *     @(#)extern.h    5.4 (Berkeley) %G%
  */
 
 struct entry   *addentry __P((char *, ino_t, int));
  */
 
 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 *));
 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));
 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));
 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 *));
 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));
 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 *));
 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));
 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));
index 8b10e2a..fb57d10 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)interactive.c      5.19 (Berkeley) %G%";
+static char sccsid[] = "@(#)interactive.c      5.20 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -55,7 +55,6 @@ struct arglist {
 
 static char    *copynext __P((char *, char *));
 static int      fcmp __P((const void *, const void *));
 
 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));
 static void     formatf __P((struct afile *, int));
 static void     getcmd __P((char *, char *, char *, struct arglist *));
 struct dirent  *glob_readdir __P((RST_DIR *dirp));
index b3365c2..0e620c4 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #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 <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -45,7 +45,6 @@ time_t        dumptime;
 time_t dumpdate;
 FILE   *terminal;
 
 time_t dumpdate;
 FILE   *terminal;
 
-static void err __P((const char *, ...));
 static void obsolete __P((int *, char **[]));
 static void usage __P((void));
 
 static void obsolete __P((int *, char **[]));
 static void usage __P((void));
 
@@ -323,7 +322,7 @@ obsolete(argcp, argvp)
 #include <varargs.h>
 #endif
 
 #include <varargs.h>
 #endif
 
-void
+__dead void
 #if __STDC__
 err(const char *fmt, ...)
 #else
 #if __STDC__
 err(const char *fmt, ...)
 #else
index 002990c..bde57d6 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)symtab.c   5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)symtab.c   5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -149,7 +149,7 @@ lookupparent(name)
        char *tailindex;
 
        tailindex = rindex(name, '/');
        char *tailindex;
 
        tailindex = rindex(name, '/');
-       if (tailindex == 0)
+       if (tailindex == NULL)
                return (NULL);
        *tailindex = '\0';
        ep = lookupname(name);
                return (NULL);
        *tailindex = '\0';
        ep = lookupname(name);
index dc7af71..5fafb6d 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)tape.c     5.35 (Berkeley) %G%";
+static char sccsid[] = "@(#)tape.c     5.36 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -150,7 +150,7 @@ setup()
        vprintf(stdout, "Verify tape and initialize maps\n");
 #ifdef RRESTORE
        if (host)
        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)
        else
 #endif
        if (pipein)