summaryrefslogtreecommitdiffstats
path: root/sbin/restore
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1998-07-28 06:20:16 +0000
committercharnier <charnier@FreeBSD.org>1998-07-28 06:20:16 +0000
commitfbfb398b38056006ff0b633f6a6b17824fae8a7f (patch)
treeebaabb894695876e497c4139aff2bf9f748a0a62 /sbin/restore
parent39614096be6a83865a0e929b75441f8656f5bd9d (diff)
downloadFreeBSD-src-fbfb398b38056006ff0b633f6a6b17824fae8a7f.zip
FreeBSD-src-fbfb398b38056006ff0b633f6a6b17824fae8a7f.tar.gz
Add rcsid. Remove unused #includes. Add missing prototypes and others -Wall
cleanings. Spelling.
Diffstat (limited to 'sbin/restore')
-rw-r--r--sbin/restore/dirs.c12
-rw-r--r--sbin/restore/extern.h3
-rw-r--r--sbin/restore/interactive.c14
-rw-r--r--sbin/restore/main.c14
-rw-r--r--sbin/restore/restore.84
-rw-r--r--sbin/restore/restore.c15
-rw-r--r--sbin/restore/symtab.c12
-rw-r--r--sbin/restore/tape.c7
-rw-r--r--sbin/restore/utilities.c5
9 files changed, 51 insertions, 35 deletions
diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c
index 4276454..15d7b06 100644
--- a/sbin/restore/dirs.c
+++ b/sbin/restore/dirs.c
@@ -34,32 +34,30 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: dirs.c,v 1.10 1997/09/18 14:04:49 phk Exp $
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)dirs.c 8.7 (Berkeley) 5/1/95";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
#include <sys/file.h>
#include <sys/stat.h>
-#include <sys/time.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h>
-#include <ufs/ffs/fs.h>
#include <protocols/dumprestore.h>
+#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <err.h>
-
-#include <machine/endian.h>
#include "pathnames.h"
#include "restore.h"
diff --git a/sbin/restore/extern.h b/sbin/restore/extern.h
index c82f997..34900e2 100644
--- a/sbin/restore/extern.h
+++ b/sbin/restore/extern.h
@@ -31,10 +31,12 @@
* SUCH DAMAGE.
*
* @(#)extern.h 8.2 (Berkeley) 1/7/94
+ * $Id$
*/
struct entry *addentry __P((char *, ino_t, int));
long addfile __P((char *, ino_t, int));
+int addwhiteout __P((char *));
void badentry __P((struct entry *, char *));
void canon __P((char *, char *, int));
void checkrestore __P((void));
@@ -44,6 +46,7 @@ void createleaves __P((char *));
void createlinks __P((void));
long deletefile __P((char *, ino_t, int));
void deleteino __P((ino_t));
+void delwhiteout __P((struct entry *));
ino_t dirlookup __P((const char *));
void done __P((int)) __dead2;
void dumpsymtable __P((char *, long));
diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c
index 600cc90..09548c5 100644
--- a/sbin/restore/interactive.c
+++ b/sbin/restore/interactive.c
@@ -32,16 +32,18 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)interactive.c 8.5 (Berkeley) 5/1/95";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
-#include <sys/time.h>
#include <sys/stat.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h>
-#include <ufs/ffs/fs.h>
#include <protocols/dumprestore.h>
#include <setjmp.h>
@@ -436,7 +438,7 @@ copynext(input, output)
/*
* Canonicalize file names to always start with ``./'' and
- * remove any imbedded "." and ".." components.
+ * remove any embedded "." and ".." components.
*/
void
canon(rawname, canonname, len)
@@ -452,7 +454,7 @@ canon(rawname, canonname, len)
else
(void) strcpy(canonname, "./");
if (strlen(canonname) + strlen(rawname) >= len) {
- fprintf(stderr, "canonname: not enough bufferspace\n");
+ fprintf(stderr, "canonname: not enough buffer space\n");
done(1);
}
@@ -522,7 +524,7 @@ printlist(name, basename)
}
} else {
entries = 0;
- while (dp = rst_readdir(dirp))
+ while ((dp = rst_readdir(dirp)))
entries++;
rst_closedir(dirp);
list = (struct afile *)malloc(entries * sizeof(struct afile));
@@ -538,7 +540,7 @@ printlist(name, basename)
(void) strncpy(locname, name, MAXPATHLEN);
(void) strncat(locname, "/", MAXPATHLEN);
namelen = strlen(locname);
- while (dp = rst_readdir(dirp)) {
+ while ((dp = rst_readdir(dirp))) {
if (dp == NULL)
break;
if (!dflag && TSTINO(dp->d_ino, dumpmap) == 0)
diff --git a/sbin/restore/main.c b/sbin/restore/main.c
index 3bc4e8b3..cddf32b 100644
--- a/sbin/restore/main.c
+++ b/sbin/restore/main.c
@@ -32,28 +32,28 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/4/95";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
-#include <sys/time.h>
+#include <sys/stat.h>
#include <ufs/ufs/dinode.h>
-#include <ufs/ffs/fs.h>
#include <protocols/dumprestore.h>
#include <err.h>
-#include <errno.h>
-#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include "pathnames.h"
@@ -365,7 +365,7 @@ obsolete(argcp, argvp)
}
/* Copy remaining arguments. */
- while (*nargv++ = *argv++);
+ while ((*nargv++ = *argv++));
/* Update argument count. */
*argcp = nargv - *argvp - 1;
diff --git a/sbin/restore/restore.8 b/sbin/restore/restore.8
index a38d5b0..cb8264d 100644
--- a/sbin/restore/restore.8
+++ b/sbin/restore/restore.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)restore.8 8.4 (Berkeley) 5/1/95
-.\" $Id: restore.8,v 1.11 1997/04/29 17:48:58 wollman Exp $
+.\" $Id: restore.8,v 1.12 1998/05/09 05:22:56 jkh Exp $
.\"
.Dd May 1, 1995
.Dt RESTORE 8
@@ -269,7 +269,7 @@ tries to determine the media block size dynamically.
Normally,
.Nm restore
will try to determine dynamically whether the dump was made from an
-old (pre-4.4) or new format file sytem. The
+old (pre-4.4) or new format file system. The
.Fl c
flag disables this check, and only allows reading a dump in the old
format.
diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c
index f2d526a..f983c69 100644
--- a/sbin/restore/restore.c
+++ b/sbin/restore/restore.c
@@ -32,11 +32,14 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)restore.c 8.3 (Berkeley) 9/13/94";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
-#include <sys/stat.h>
#include <ufs/ufs/dinode.h>
@@ -163,7 +166,7 @@ removeoldleaves()
register ino_t i, mydirino;
vprintf(stdout, "Mark entries to be removed.\n");
- if (ep = lookupino(WINO)) {
+ if ((ep = lookupino(WINO))) {
vprintf(stdout, "Delete whiteouts\n");
for ( ; ep != NULL; ep = nextep) {
nextep = ep->e_links;
@@ -451,7 +454,7 @@ nodeupdates(name, ino, type)
break;
/*
- * A hard link to a diirectory that has been removed.
+ * A hard link to a directory that has been removed.
* Ignore it.
*/
case NAMEFND:
@@ -651,7 +654,7 @@ createleaves(symtabfile)
/*
* If the file is to be extracted, then the old file must
* be removed since its type may change from one leaf type
- * to another (eg "file" to "character special").
+ * to another (e.g. "file" to "character special").
*/
if ((ep->e_flags & EXTRACT) != 0) {
removeleaf(ep);
@@ -661,7 +664,7 @@ createleaves(symtabfile)
ep->e_flags &= ~(NEW|EXTRACT);
/*
* We checkpoint the restore after every tape reel, so
- * as to simplify the amount of work re quired by the
+ * as to simplify the amount of work required by the
* 'R' command.
*/
next:
@@ -772,7 +775,7 @@ createlinks()
register ino_t i;
char name[BUFSIZ];
- if (ep = lookupino(WINO)) {
+ if ((ep = lookupino(WINO))) {
vprintf(stdout, "Add whiteouts\n");
for ( ; ep != NULL; ep = ep->e_links) {
if ((ep->e_flags & NEW) == 0)
diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c
index 6895053..f9a5422 100644
--- a/sbin/restore/symtab.c
+++ b/sbin/restore/symtab.c
@@ -32,7 +32,11 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)symtab.c 8.3 (Berkeley) 4/28/95";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
/*
@@ -213,7 +217,7 @@ myname(ep)
}
/*
- * Unused symbol table entries are linked together on a freelist
+ * Unused symbol table entries are linked together on a free list
* headed by the following pointer.
*/
static struct entry *freelist = NULL;
@@ -257,7 +261,7 @@ addentry(name, inum, type)
if (type & LINK) {
ep = lookupino(inum);
if (ep == NULL)
- panic("link to non-existant name\n");
+ panic("link to non-existent name\n");
np->e_ino = inum;
np->e_links = ep->e_links;
ep->e_links = np;
@@ -374,7 +378,7 @@ removeentry(ep)
* of similar lengths can use the same entry. The value of STRTBLINCR
* is chosen so that every entry has at least enough space to hold
* a "struct strtbl" header. Thus every entry can be linked onto an
- * apprpriate free list.
+ * appropriate free list.
*
* NB. The macro "allocsize" below assumes that "struct strhdr"
* has a size that is a power of two.
@@ -470,7 +474,7 @@ dumpsymtable(filename, checkpt)
}
clearerr(fd);
/*
- * Assign indicies to each entry
+ * Assign indices to each entry
* Write out the string entries
*/
for (i = WINO; i <= maxino; i++) {
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 597b0ba..9cf1d3f 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -37,12 +37,15 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)tape.c 8.9 (Berkeley) 5/1/95";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
#include <sys/file.h>
-#include <sys/ioctl.h>
#include <sys/mtio.h>
#include <sys/stat.h>
@@ -283,7 +286,7 @@ setup()
* Prompt user to load a new dump volume.
* "Nextvol" is the next suggested volume to use.
* This suggested volume is enforced when doing full
- * or incremental restores, but can be overrridden by
+ * or incremental restores, but can be overridden by
* the user when only extracting a subset of the files.
*/
void
diff --git a/sbin/restore/utilities.c b/sbin/restore/utilities.c
index 265b596..3a8a47d 100644
--- a/sbin/restore/utilities.c
+++ b/sbin/restore/utilities.c
@@ -32,7 +32,11 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)utilities.c 8.5 (Berkeley) 4/28/95";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -43,7 +47,6 @@ static char sccsid[] = "@(#)utilities.c 8.5 (Berkeley) 4/28/95";
#include <errno.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <unistd.h>
OpenPOWER on IntegriCloud