Add rcsid. Remove unused #includes. Add missing prototypes and others -Wall

cleanings. Spelling.
This commit is contained in:
Philippe Charnier 1998-07-28 06:20:16 +00:00
parent 4b8a1af6a2
commit 91ac32e405
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37906
9 changed files with 51 additions and 35 deletions

View File

@ -34,32 +34,30 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * 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 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*
* $Id: dirs.c,v 1.10 1997/09/18 14:04:49 phk Exp $
*/ */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)dirs.c 8.7 (Berkeley) 5/1/95"; static char sccsid[] = "@(#)dirs.c 8.7 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h>
#include <ufs/ufs/dinode.h> #include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h> #include <ufs/ufs/dir.h>
#include <ufs/ffs/fs.h>
#include <protocols/dumprestore.h> #include <protocols/dumprestore.h>
#include <err.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <err.h>
#include <machine/endian.h>
#include "pathnames.h" #include "pathnames.h"
#include "restore.h" #include "restore.h"

View File

@ -31,10 +31,12 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)extern.h 8.2 (Berkeley) 1/7/94 * @(#)extern.h 8.2 (Berkeley) 1/7/94
* $Id$
*/ */
struct entry *addentry __P((char *, ino_t, int)); struct entry *addentry __P((char *, ino_t, int));
long addfile __P((char *, ino_t, int)); long addfile __P((char *, ino_t, int));
int addwhiteout __P((char *));
void badentry __P((struct entry *, char *)); void badentry __P((struct entry *, char *));
void canon __P((char *, char *, int)); void canon __P((char *, char *, int));
void checkrestore __P((void)); void checkrestore __P((void));
@ -44,6 +46,7 @@ void createleaves __P((char *));
void createlinks __P((void)); void createlinks __P((void));
long deletefile __P((char *, ino_t, int)); long deletefile __P((char *, ino_t, int));
void deleteino __P((ino_t)); void deleteino __P((ino_t));
void delwhiteout __P((struct entry *));
ino_t dirlookup __P((const char *)); ino_t dirlookup __P((const char *));
void done __P((int)) __dead2; void done __P((int)) __dead2;
void dumpsymtable __P((char *, long)); void dumpsymtable __P((char *, long));

View File

@ -32,16 +32,18 @@
*/ */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)interactive.c 8.5 (Berkeley) 5/1/95"; static char sccsid[] = "@(#)interactive.c 8.5 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
#include <sys/time.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <ufs/ufs/dinode.h> #include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h> #include <ufs/ufs/dir.h>
#include <ufs/ffs/fs.h>
#include <protocols/dumprestore.h> #include <protocols/dumprestore.h>
#include <setjmp.h> #include <setjmp.h>
@ -436,7 +438,7 @@ copynext(input, output)
/* /*
* Canonicalize file names to always start with ``./'' and * Canonicalize file names to always start with ``./'' and
* remove any imbedded "." and ".." components. * remove any embedded "." and ".." components.
*/ */
void void
canon(rawname, canonname, len) canon(rawname, canonname, len)
@ -452,7 +454,7 @@ canon(rawname, canonname, len)
else else
(void) strcpy(canonname, "./"); (void) strcpy(canonname, "./");
if (strlen(canonname) + strlen(rawname) >= len) { if (strlen(canonname) + strlen(rawname) >= len) {
fprintf(stderr, "canonname: not enough bufferspace\n"); fprintf(stderr, "canonname: not enough buffer space\n");
done(1); done(1);
} }
@ -522,7 +524,7 @@ printlist(name, basename)
} }
} else { } else {
entries = 0; entries = 0;
while (dp = rst_readdir(dirp)) while ((dp = rst_readdir(dirp)))
entries++; entries++;
rst_closedir(dirp); rst_closedir(dirp);
list = (struct afile *)malloc(entries * sizeof(struct afile)); list = (struct afile *)malloc(entries * sizeof(struct afile));
@ -538,7 +540,7 @@ printlist(name, basename)
(void) strncpy(locname, name, MAXPATHLEN); (void) strncpy(locname, name, MAXPATHLEN);
(void) strncat(locname, "/", MAXPATHLEN); (void) strncat(locname, "/", MAXPATHLEN);
namelen = strlen(locname); namelen = strlen(locname);
while (dp = rst_readdir(dirp)) { while ((dp = rst_readdir(dirp))) {
if (dp == NULL) if (dp == NULL)
break; break;
if (!dflag && TSTINO(dp->d_ino, dumpmap) == 0) if (!dflag && TSTINO(dp->d_ino, dumpmap) == 0)

View File

@ -32,28 +32,28 @@
*/ */
#ifndef lint #ifndef lint
static char copyright[] = static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\ "@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n"; The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
#include <sys/time.h> #include <sys/stat.h>
#include <ufs/ufs/dinode.h> #include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#include <protocols/dumprestore.h> #include <protocols/dumprestore.h>
#include <err.h> #include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include "pathnames.h" #include "pathnames.h"
@ -365,7 +365,7 @@ obsolete(argcp, argvp)
} }
/* Copy remaining arguments. */ /* Copy remaining arguments. */
while (*nargv++ = *argv++); while ((*nargv++ = *argv++));
/* Update argument count. */ /* Update argument count. */
*argcp = nargv - *argvp - 1; *argcp = nargv - *argvp - 1;

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" @(#)restore.8 8.4 (Berkeley) 5/1/95 .\" @(#)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 .Dd May 1, 1995
.Dt RESTORE 8 .Dt RESTORE 8
@ -269,7 +269,7 @@ tries to determine the media block size dynamically.
Normally, Normally,
.Nm restore .Nm restore
will try to determine dynamically whether the dump was made from an 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 .Fl c
flag disables this check, and only allows reading a dump in the old flag disables this check, and only allows reading a dump in the old
format. format.

View File

@ -32,11 +32,14 @@
*/ */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)restore.c 8.3 (Berkeley) 9/13/94"; static char sccsid[] = "@(#)restore.c 8.3 (Berkeley) 9/13/94";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <ufs/ufs/dinode.h> #include <ufs/ufs/dinode.h>
@ -163,7 +166,7 @@ removeoldleaves()
register ino_t i, mydirino; register ino_t i, mydirino;
vprintf(stdout, "Mark entries to be removed.\n"); vprintf(stdout, "Mark entries to be removed.\n");
if (ep = lookupino(WINO)) { if ((ep = lookupino(WINO))) {
vprintf(stdout, "Delete whiteouts\n"); vprintf(stdout, "Delete whiteouts\n");
for ( ; ep != NULL; ep = nextep) { for ( ; ep != NULL; ep = nextep) {
nextep = ep->e_links; nextep = ep->e_links;
@ -451,7 +454,7 @@ nodeupdates(name, ino, type)
break; break;
/* /*
* A hard link to a diirectory that has been removed. * A hard link to a directory that has been removed.
* Ignore it. * Ignore it.
*/ */
case NAMEFND: case NAMEFND:
@ -651,7 +654,7 @@ createleaves(symtabfile)
/* /*
* If the file is to be extracted, then the old file must * If the file is to be extracted, then the old file must
* be removed since its type may change from one leaf type * 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) { if ((ep->e_flags & EXTRACT) != 0) {
removeleaf(ep); removeleaf(ep);
@ -661,7 +664,7 @@ createleaves(symtabfile)
ep->e_flags &= ~(NEW|EXTRACT); ep->e_flags &= ~(NEW|EXTRACT);
/* /*
* We checkpoint the restore after every tape reel, so * 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. * 'R' command.
*/ */
next: next:
@ -772,7 +775,7 @@ createlinks()
register ino_t i; register ino_t i;
char name[BUFSIZ]; char name[BUFSIZ];
if (ep = lookupino(WINO)) { if ((ep = lookupino(WINO))) {
vprintf(stdout, "Add whiteouts\n"); vprintf(stdout, "Add whiteouts\n");
for ( ; ep != NULL; ep = ep->e_links) { for ( ; ep != NULL; ep = ep->e_links) {
if ((ep->e_flags & NEW) == 0) if ((ep->e_flags & NEW) == 0)

View File

@ -32,7 +32,11 @@
*/ */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)symtab.c 8.3 (Berkeley) 4/28/95"; static char sccsid[] = "@(#)symtab.c 8.3 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */ #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. * headed by the following pointer.
*/ */
static struct entry *freelist = NULL; static struct entry *freelist = NULL;
@ -257,7 +261,7 @@ addentry(name, inum, type)
if (type & LINK) { if (type & LINK) {
ep = lookupino(inum); ep = lookupino(inum);
if (ep == NULL) if (ep == NULL)
panic("link to non-existant name\n"); panic("link to non-existent name\n");
np->e_ino = inum; np->e_ino = inum;
np->e_links = ep->e_links; np->e_links = ep->e_links;
ep->e_links = np; ep->e_links = np;
@ -374,7 +378,7 @@ removeentry(ep)
* of similar lengths can use the same entry. The value of STRTBLINCR * 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 * 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 * 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" * NB. The macro "allocsize" below assumes that "struct strhdr"
* has a size that is a power of two. * has a size that is a power of two.
@ -470,7 +474,7 @@ dumpsymtable(filename, checkpt)
} }
clearerr(fd); clearerr(fd);
/* /*
* Assign indicies to each entry * Assign indices to each entry
* Write out the string entries * Write out the string entries
*/ */
for (i = WINO; i <= maxino; i++) { for (i = WINO; i <= maxino; i++) {

View File

@ -37,12 +37,15 @@
*/ */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)tape.c 8.9 (Berkeley) 5/1/95"; static char sccsid[] = "@(#)tape.c 8.9 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/mtio.h> #include <sys/mtio.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -283,7 +286,7 @@ setup()
* Prompt user to load a new dump volume. * Prompt user to load a new dump volume.
* "Nextvol" is the next suggested volume to use. * "Nextvol" is the next suggested volume to use.
* This suggested volume is enforced when doing full * 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. * the user when only extracting a subset of the files.
*/ */
void void

View File

@ -32,7 +32,11 @@
*/ */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)utilities.c 8.5 (Berkeley) 4/28/95"; static char sccsid[] = "@(#)utilities.c 8.5 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -43,7 +47,6 @@ static char sccsid[] = "@(#)utilities.c 8.5 (Berkeley) 4/28/95";
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>