Merge Lite2 changes (rather bigish, the dump/restore folks should check)

This commit is contained in:
peter 1997-03-11 12:09:50 +00:00
parent b44b4b434e
commit 9fd0eac987
6 changed files with 230 additions and 182 deletions

View File

@ -30,10 +30,10 @@
.\" 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.
.\" .\"
.\" @(#)dump.8 8.1 (Berkeley) 6/16/93 .\" @(#)dump.8 8.3 (Berkeley) 5/1/95
.\" $Id$ .\" $Id: dump.8,v 1.12 1997/02/22 14:32:16 peter Exp $
.\" .\"
.Dd June 16, 1993 .Dd May 1, 1995
.Dt DUMP 8 .Dt DUMP 8
.Os BSD 4 .Os BSD 4
.Sh NAME .Sh NAME
@ -41,8 +41,23 @@
.Nd filesystem backup .Nd filesystem backup
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm dump .Nm dump
.Op Cm 0123456789BTWabcdfhnsu Op Ar argument ... .Op Fl 0123456789acnu
.Op Ar filesystem .Op Fl B Ar records
.Op Fl b Ar blocksize
.Op Fl d Ar density
.Op Fl f Ar file
.Op Fl h Ar level
.Op Fl s Ar feet
.Op Fl T Ar date
.Ar filesystem
.Nm dump
.Op Fl W Li \&| Fl w
.Pp
.in -\\n(iSu
(The
.Bx 4.3
option syntax is implemented for backward compatibility, but
is not documented here.)
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm Dump .Nm Dump
examines files examines files
@ -51,7 +66,7 @@ and determines which files
need to be backed up. These files need to be backed up. These files
are copied to the given disk, tape or other are copied to the given disk, tape or other
storage medium for safe keeping (see the storage medium for safe keeping (see the
.Cm f .Fl f
option below for doing remote backups). option below for doing remote backups).
A dump that is larger than the output medium is broken into A dump that is larger than the output medium is broken into
multiple volumes. multiple volumes.
@ -70,26 +85,26 @@ By default, the same output file name is used for each volume
after prompting the operator to change media. after prompting the operator to change media.
.Pp .Pp
The following options are supported by The following options are supported by
.Nm dump: .Nm dump :
.Bl -tag -width 4n .Bl -tag -width Ds
.It Cm 0\-9 .It Fl 0\-9
Dump levels. Dump levels.
A level 0, full backup, A level 0, full backup,
guarantees the entire file system is copied guarantees the entire file system is copied
(but see also the (but see also the
.Cm h .Fl h
option below). option below).
A level number above 0, A level number above 0,
incremental backup, incremental backup,
tells dump to tells dump to
copy all files new or modified since the copy all files new or modified since the
last dump of the same or lower level. The default last dump of the same or lower level.
level is 9. The default level is 9.
.It Cm B Ar records .It Fl B Ar records
The number of dump records per volume. The number of dump records per volume.
This option overrides the calculation of tape size This option overrides the calculation of tape size
based on length and density. based on length and density.
.It Cm a .It Fl a
.Dq auto-size . .Dq auto-size .
Bypass all tape length considerations, and enforce writing Bypass all tape length considerations, and enforce writing
until an end-of-media indication is returned. This fits best until an end-of-media indication is returned. This fits best
@ -97,12 +112,12 @@ for most modern tape drives. Use of this option is particularly
recommended when appending to an existing tape, or using a tape recommended when appending to an existing tape, or using a tape
drive with hardware compression (where you can never be sure about drive with hardware compression (where you can never be sure about
the compression ratio). the compression ratio).
.It Cm b Ar blocksize .It Fl b Ar blocksize
The number of kilobytes per dump record. The number of kilobytes per dump record.
.It Cm c .It Fl c
Change the defaults for use with a cartridge tape drive, with a density Change the defaults for use with a cartridge tape drive, with a density
of 8000 bpi, and a length of 1700 feet. of 8000 bpi, and a length of 1700 feet.
.It Cm h Ar level .It Fl h Ar level
Honor the user Honor the user
.Dq nodump .Dq nodump
flag flag
@ -112,7 +127,11 @@ only for dumps at or above the given
The default honor level is 1, The default honor level is 1,
so that incremental backups omit such files so that incremental backups omit such files
but full backups retain them. but full backups retain them.
.It Cm f Ar file .It Fl d Ar density
Set tape density to
.Ar density .
The default is 1600BPI.
.It Fl f Ar file
Write the backup to Write the backup to
.Ar file ; .Ar file ;
.Ar file .Ar file
@ -145,11 +164,7 @@ program is
.Pa /etc/rmt ; .Pa /etc/rmt ;
this can be overridden by the environment variable this can be overridden by the environment variable
.Ev RMT . .Ev RMT .
.It Cm d Ar density .It Fl n
Set tape density to
.Ar density .
The default is 1600BPI.
.It Cm n
Whenever Whenever
.Nm dump .Nm dump
requires operator attention, requires operator attention,
@ -157,7 +172,7 @@ notify all operators in the group
.Dq operator .Dq operator
by means similar to a by means similar to a
.Xr wall 1 . .Xr wall 1 .
.It Cm s Ar feet .It Fl s Ar feet
Attempt to calculate the amount of tape needed Attempt to calculate the amount of tape needed
at a particular density. at a particular density.
If this amount is exceeded, If this amount is exceeded,
@ -165,7 +180,21 @@ If this amount is exceeded,
prompts for a new tape. prompts for a new tape.
It is recommended to be a bit conservative on this option. It is recommended to be a bit conservative on this option.
The default tape length is 2300 feet. The default tape length is 2300 feet.
.It Cm u .ne 1i
.It Fl T Ar date
Use the specified date as the starting time for the dump
instead of the time determined from looking in
.Pa /etc/dumpdates .
The format of date is the same as that of
.Xr ctime 3 .
This option is useful for automated dump scripts that wish to
dump over a specific period of time.
The
.Fl T
option is mutually exclusive from the
.Fl u
option.
.It Fl u
Update the file Update the file
.Pa /etc/dumpdates .Pa /etc/dumpdates
after a successful dump. after a successful dump.
@ -183,20 +212,7 @@ The file
.Pa /etc/dumpdates .Pa /etc/dumpdates
may be edited to change any of the fields, may be edited to change any of the fields,
if necessary. if necessary.
.It Cm T Ar date .It Fl W
Use the specified date as the starting time for the dump
instead of the time determined from looking in
.Pa /etc/dumpdates .
The format of date is the same as that of
.Xr ctime 3 .
This option is useful for automated dump scripts that wish to
dump over a specific period of time.
The
.Cm T
option is mutually exclusive from the
.Cm u
option.
.It Cm W
.Nm Dump .Nm Dump
tells the operator what file systems need to be dumped. tells the operator what file systems need to be dumped.
This information is gleaned from the files This information is gleaned from the files
@ -204,7 +220,7 @@ This information is gleaned from the files
and and
.Pa /etc/fstab . .Pa /etc/fstab .
The The
.Cm W .Fl W
option causes option causes
.Nm dump .Nm dump
to print out, for each file system in to print out, for each file system in
@ -212,11 +228,11 @@ to print out, for each file system in
the most recent dump date and level, the most recent dump date and level,
and highlights those file systems that should be dumped. and highlights those file systems that should be dumped.
If the If the
.Cm W .Fl W
option is set, all other options are ignored, and option is set, all other options are ignored, and
.Nm dump .Nm dump
exits immediately. exits immediately.
.It Cm w .It Fl w
Is like W, but prints only those filesystems which need to be dumped. Is like W, but prints only those filesystems which need to be dumped.
.El .El
.Pp .Pp
@ -228,7 +244,7 @@ tape write error,
tape open error or tape open error or
disk read error (if there are more than a threshold of 32). disk read error (if there are more than a threshold of 32).
In addition to alerting all operators implied by the In addition to alerting all operators implied by the
.Cm n .Fl n
key, key,
.Nm dump .Nm dump
interacts with the operator on interacts with the operator on
@ -279,7 +295,7 @@ to minimize the number of tapes follows:
.It .It
Always start with a level 0 backup, for example: Always start with a level 0 backup, for example:
.Bd -literal -offset indent .Bd -literal -offset indent
/sbin/dump 0uf /dev/nrst0 /usr/src /sbin/dump -0u -f /dev/nrst0 /usr/src
.Ed .Ed
.Pp .Pp
This should be done at set intervals, say once a month or once every two months, This should be done at set intervals, say once a month or once every two months,
@ -334,8 +350,8 @@ Dump exits with zero status on success.
Startup errors are indicated with an exit code of 1; Startup errors are indicated with an exit code of 1;
abnormal termination is indicated with an exit code of 3. abnormal termination is indicated with an exit code of 3.
.Sh BUGS .Sh BUGS
.Pp
Fewer than 32 read errors on the filesystem are ignored. Fewer than 32 read errors on the filesystem are ignored.
.Pp
Each reel requires a new process, so parent processes for Each reel requires a new process, so parent processes for
reels already written just hang around until the entire tape reels already written just hang around until the entire tape
is written. is written.
@ -349,9 +365,9 @@ will prevent this from happening.
.Pp .Pp
.Nm Dump .Nm Dump
with the with the
.Cm W .Fl W
or or
.Cm w .Fl w
options does not report filesystems that have never been recorded options does not report filesystems that have never been recorded
in in
.Pa /etc/dumpdates , .Pa /etc/dumpdates ,

View File

@ -30,7 +30,7 @@
* 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.
* *
* @(#)dump.h 8.1 (Berkeley) 6/5/93 * @(#)dump.h 8.2 (Berkeley) 4/28/95
*/ */
#define MAXINOPB (MAXBSIZE / sizeof(struct dinode)) #define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
@ -186,8 +186,9 @@ void sig __P((int signo));
*/ */
#ifdef COMPAT #ifdef COMPAT
#include <sys/file.h> #include <sys/file.h>
extern char *index(), *rindex(), *strdup(); #define strchr(a,b) index(a,b)
extern char *ctime(); #define strrchr(a,b) rindex(a,b)
extern char *strdup(), *ctime();
extern int read(), write(); extern int read(), write();
extern int errno; extern int errno;
#endif #endif

View File

@ -32,7 +32,7 @@
*/ */
#ifndef lint #ifndef lint
static char sccsid[] = "@(#)dumprmt.c 8.1 (Berkeley) 6/5/93"; static char sccsid[] = "@(#)dumprmt.c 8.3 (Berkeley) 4/28/95";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -55,6 +55,7 @@ static char sccsid[] = "@(#)dumprmt.c 8.1 (Berkeley) 6/5/93";
#include <protocols/dumprestore.h> #include <protocols/dumprestore.h>
#include <ctype.h> #include <ctype.h>
#include <err.h>
#include <netdb.h> #include <netdb.h>
#include <pwd.h> #include <pwd.h>
#include <signal.h> #include <signal.h>
@ -157,7 +158,7 @@ rmtgetconn()
exit(X_ABORT); exit(X_ABORT);
} }
} }
if ((cp = index(rmtpeer, '@')) != NULL) { if ((cp = strchr(rmtpeer, '@')) != NULL) {
tuser = rmtpeer; tuser = rmtpeer;
*cp = '\0'; *cp = '\0';
if (!okname(tuser)) if (!okname(tuser))

View File

@ -38,7 +38,7 @@ static char copyright[] =
#endif /* not lint */ #endif /* not lint */
#ifndef lint #ifndef lint
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 4/15/94"; static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -49,23 +49,22 @@ static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 4/15/94";
#include <ufs/inode.h> #include <ufs/inode.h>
#include <ufs/fs.h> #include <ufs/fs.h>
#else #else
#include <ufs/ffs/fs.h>
#include <ufs/ufs/dinode.h> #include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#endif #endif
#include <protocols/dumprestore.h> #include <protocols/dumprestore.h>
#include <ctype.h> #include <ctype.h>
#include <err.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <fstab.h> #include <fstab.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#ifdef __STDC__
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#endif
#include "dump.h" #include "dump.h"
#include "pathnames.h" #include "pathnames.h"
@ -84,20 +83,21 @@ long dev_bsize = 1; /* recalculated below */
long blocksperfile; /* output blocks per file */ long blocksperfile; /* output blocks per file */
char *host = NULL; /* remote host (if any) */ char *host = NULL; /* remote host (if any) */
static long numarg __P((int, char *, long, long, int *, char ***)); static long numarg __P((char *, long, long));
static void missingarg __P((int, char *)) __dead2; static void obsolete __P((int *, char **[]));
static void usage __P((void));
int int
main(argc, argv) main(argc, argv)
int argc; int argc;
char **argv; char *argv[];
{ {
register ino_t ino; register ino_t ino;
register int dirty; register int dirty;
register struct dinode *dp; register struct dinode *dp;
register struct fstab *dt; register struct fstab *dt;
register char *map; register char *map;
register char *cp; register int ch;
int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1; int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1;
ino_t maxino; ino_t maxino;
@ -112,62 +112,31 @@ main(argc, argv)
if (TP_BSIZE / DEV_BSIZE == 0 || TP_BSIZE % DEV_BSIZE != 0) if (TP_BSIZE / DEV_BSIZE == 0 || TP_BSIZE % DEV_BSIZE != 0)
quit("TP_BSIZE must be a multiple of DEV_BSIZE\n"); quit("TP_BSIZE must be a multiple of DEV_BSIZE\n");
level = '0'; level = '0';
if (argc == 1) {
(void) fprintf(stderr, "Must specify a key.\n"); if (argc < 2)
Exit(X_ABORT); usage();
}
argv++; obsolete(&argc, &argv);
argc -= 2; while ((ch = getopt(argc, argv, "0123456789B:b:cd:f:h:ns:T:uWw")) != -1)
for (cp = *argv++; cp != NULL && *cp != '\0'; cp++) { switch (ch) {
switch (*cp) { /* dump level */
case '-': case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
level = ch;
break; break;
case 'w': case 'a': /* `auto-size', Write to EOM. */
lastdump('w'); /* tell us only what has to be done */ unlimited = 1;
exit(0);
case 'W': /* what to do */
lastdump('W'); /* tell us state of what is done */
exit(0); /* do nothing else */
case 'f': /* output file */
if (argc < 1)
missingarg('f', "output file");
tape = *argv++;
argc--;
break; break;
case 'd': /* density, in bits per inch */ case 'B': /* blocks per output file */
density = numarg('d', "density", blocksperfile = numarg("number of blocks per file",
10L, 327670L, &argc, &argv) / 10; 1L, 0L);
if (density >= 625 && !bflag)
ntrec = HIGHDENSITYTREC;
break;
case 's': /* tape size, feet */
tsize = numarg('s', "size",
1L, 0L, &argc, &argv) * 12 * 10;
break;
case 'T': /* time of last dump */
if (argc < 1)
missingarg('T', "time of last dump");
spcl.c_ddate = unctime(*argv);
if (spcl.c_ddate < 0) {
(void)fprintf(stderr, "bad time \"%s\"\n",
*argv);
exit(X_ABORT);
}
Tflag = 1;
lastlevel = '?';
argc--;
argv++;
break; break;
case 'b': /* blocks per tape write */ case 'b': /* blocks per tape write */
ntrec = numarg('b', "number of blocks per write", ntrec = numarg("number of blocks per write",
1L, 1000L, &argc, &argv); 1L, 1000L);
/* /*
* XXX * XXX
* physio(9) currently slices all requests to * physio(9) currently slices all requests to
@ -184,43 +153,60 @@ main(argc, argv)
} }
break; break;
case 'B': /* blocks per output file */
blocksperfile = numarg('B', "number of blocks per file",
1L, 0L, &argc, &argv);
break;
case 'c': /* Tape is cart. not 9-track */ case 'c': /* Tape is cart. not 9-track */
cartridge = 1; cartridge = 1;
break; break;
case 'a': /* `auto-size', Write to EOM. */ case 'd': /* density, in bits per inch */
unlimited = 1; density = numarg("density", 10L, 327670L) / 10;
if (density >= 625 && !bflag)
ntrec = HIGHDENSITYTREC;
break; break;
/* dump level */ case 'f': /* output file */
case '0': case '1': case '2': case '3': case '4': tape = optarg;
case '5': case '6': case '7': case '8': case '9':
level = *cp;
break; break;
case 'u': /* update /etc/dumpdates */ case 'h':
uflag = 1; honorlevel = numarg("honor level", 0L, 10L);
break; break;
case 'n': /* notify operators */ case 'n': /* notify operators */
notify = 1; notify = 1;
break; break;
case 'h': case 's': /* tape size, feet */
honorlevel = numarg('h', "honor level", tsize = numarg("tape size", 1L, 0L) * 12 * 10;
0L, 10L, &argc, &argv);
break; break;
case 'T': /* time of last dump */
spcl.c_ddate = unctime(optarg);
if (spcl.c_ddate < 0) {
(void)fprintf(stderr, "bad time \"%s\"\n",
optarg);
exit(X_ABORT);
}
Tflag = 1;
lastlevel = '?';
argc--;
argv++;
break;
case 'u': /* update /etc/dumpdates */
uflag = 1;
break;
case 'W': /* what to do */
case 'w':
lastdump(ch);
exit(0); /* do nothing else */
default: default:
(void)fprintf(stderr, "bad key '%c'\n", *cp); usage();
exit(X_ABORT);
} }
} argc -= optind;
argv += optind;
if (argc < 1) { if (argc < 1) {
(void)fprintf(stderr, "Must specify disk or filesystem\n"); (void)fprintf(stderr, "Must specify disk or filesystem\n");
exit(X_ABORT); exit(X_ABORT);
@ -263,9 +249,9 @@ main(argc, argv)
tsize = cartridge ? 1700L*120L : 2300L*120L; tsize = cartridge ? 1700L*120L : 2300L*120L;
} }
if (index(tape, ':')) { if (strchr(tape, ':')) {
host = tape; host = tape;
tape = index(host, ':'); tape = strchr(host, ':');
*tape++ = '\0'; *tape++ = '\0';
#ifdef RDUMP #ifdef RDUMP
if (index(tape, '\n')) { if (index(tape, '\n')) {
@ -492,48 +478,33 @@ main(argc, argv)
/* NOTREACHED */ /* NOTREACHED */
} }
static void
usage()
{
(void)fprintf(stderr, "usage: dump [-0123456789cnu] [-B records] [-b blocksize] [-d density] [-f file]\n [-h level] [-s feet] [-T date] filesystem\n");
(void)fprintf(stderr, " dump [-W | -w]\n");
exit(1);
}
/* /*
* Pick up a numeric argument. It must be nonnegative and in the given * Pick up a numeric argument. It must be nonnegative and in the given
* range (except that a vmax of 0 means unlimited). * range (except that a vmax of 0 means unlimited).
*/ */
static long static long
numarg(letter, meaning, vmin, vmax, pargc, pargv) numarg(meaning, vmin, vmax)
int letter;
char *meaning; char *meaning;
long vmin, vmax; long vmin, vmax;
int *pargc;
char ***pargv;
{ {
register char *p; char *p;
long val; long val;
char *str;
if (--*pargc < 0) val = strtol(optarg, &p, 10);
missingarg(letter, meaning); if (*p)
str = *(*pargv)++; errx(1, "illegal %s -- %s", meaning, optarg);
for (p = str; *p; p++)
if (!isdigit(*p))
goto bad;
val = atol(str);
if (val < vmin || (vmax && val > vmax)) if (val < vmin || (vmax && val > vmax))
goto bad; errx(1, "%s must be between %ld and %ld", meaning, vmin, vmax);
return (val); return (val);
bad:
(void)fprintf(stderr, "bad '%c' (%s) value \"%s\"\n",
letter, meaning, str);
exit(X_ABORT);
}
static void
missingarg(letter, meaning)
int letter;
char *meaning;
{
(void)fprintf(stderr, "The '%c' flag (%s) requires an argument\n",
letter, meaning);
exit(X_ABORT);
} }
void void
@ -568,7 +539,7 @@ rawname(cp)
char *cp; char *cp;
{ {
static char rawbuf[MAXPATHLEN]; static char rawbuf[MAXPATHLEN];
char *dp = rindex(cp, '/'); char *dp = strrchr(cp, '/');
if (dp == NULL) if (dp == NULL)
return (NULL); return (NULL);
@ -581,17 +552,77 @@ rawname(cp)
return (rawbuf); return (rawbuf);
} }
#ifdef sunos /*
const char * * obsolete --
strerror(errnum) * Change set of key letters and ordered arguments into something
int errnum; * getopt(3) will like.
*/
static void
obsolete(argcp, argvp)
int *argcp;
char **argvp[];
{ {
extern int sys_nerr; int argc, flags;
extern const char *const sys_errlist[]; char *ap, **argv, *flagsp, **nargv, *p;
if (errnum < sys_nerr) /* Setup. */
return (sys_errlist[errnum]); argv = *argvp;
else argc = *argcp;
return ("bogus errno in strerror");
/* Return if no arguments or first argument has leading dash. */
ap = argv[1];
if (argc == 1 || *ap == '-')
return;
/* Allocate space for new arguments. */
if ((*argvp = nargv = malloc((argc + 1) * sizeof(char *))) == NULL ||
(p = flagsp = malloc(strlen(ap) + 2)) == NULL)
err(1, NULL);
*nargv++ = *argv;
argv += 2;
for (flags = 0; *ap; ++ap) {
switch (*ap) {
case 'a':
case 'B':
case 'b':
case 'd':
case 'f':
case 'h':
case 's':
case 'T':
if (*argv == NULL) {
warnx("option requires an argument -- %c", *ap);
usage();
}
if ((nargv[0] = malloc(strlen(*argv) + 2 + 1)) == NULL)
err(1, NULL);
nargv[0][0] = '-';
nargv[0][1] = *ap;
(void)strcpy(&nargv[0][2], *argv);
++argv;
++nargv;
break;
default:
if (!flags) {
*p++ = '-';
flags = 1;
}
*p++ = *ap;
break;
}
}
/* Terminate flags. */
if (flags) {
*p = '\0';
*nargv++ = flagsp;
}
/* Copy remaining arguments. */
while (*nargv++ = *argv++);
/* Update argument count. */
*argcp = nargv - *argvp - 1;
} }
#endif

View File

@ -32,7 +32,7 @@
*/ */
#ifndef lint #ifndef lint
static char sccsid[] = "@(#)tape.c 8.2 (Berkeley) 3/17/94"; static char sccsid[] = "@(#)tape.c 8.4 (Berkeley) 5/1/95";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -45,8 +45,8 @@ static char sccsid[] = "@(#)tape.c 8.2 (Berkeley) 3/17/94";
#include <ufs/fs.h> #include <ufs/fs.h>
#include <ufs/inode.h> #include <ufs/inode.h>
#else #else
#include <ufs/ffs/fs.h>
#include <ufs/ufs/dinode.h> #include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#endif #endif
#include <protocols/dumprestore.h> #include <protocols/dumprestore.h>
@ -584,10 +584,10 @@ startnewtape(top)
* the remaining names for subsequent volumes. * the remaining names for subsequent volumes.
*/ */
tapeno++; /* current tape sequence */ tapeno++; /* current tape sequence */
if (nexttape || index(tape, ',')) { if (nexttape || strchr(tape, ',')) {
if (nexttape && *nexttape) if (nexttape && *nexttape)
tape = nexttape; tape = nexttape;
if ((p = index(tape, ',')) != NULL) { if ((p = strchr(tape, ',')) != NULL) {
*p = '\0'; *p = '\0';
nexttape = p + 1; nexttape = p + 1;
} else } else

View File

@ -32,7 +32,7 @@
*/ */
#ifndef lint #ifndef lint
static char sccsid[] = "@(#)traverse.c 8.2 (Berkeley) 9/23/93"; static char sccsid[] = "@(#)traverse.c 8.7 (Berkeley) 6/15/95";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -45,9 +45,9 @@ static char sccsid[] = "@(#)traverse.c 8.2 (Berkeley) 9/23/93";
#include <ufs/fsdir.h> #include <ufs/fsdir.h>
#include <ufs/inode.h> #include <ufs/inode.h>
#else #else
#include <ufs/ffs/fs.h>
#include <ufs/ufs/dir.h> #include <ufs/ufs/dir.h>
#include <ufs/ufs/dinode.h> #include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#endif #endif
#include <protocols/dumprestore.h> #include <protocols/dumprestore.h>
@ -362,8 +362,7 @@ dumpino(dp, ino)
spcl.c_addr[0] = 1; spcl.c_addr[0] = 1;
spcl.c_count = 1; spcl.c_count = 1;
writeheader(ino); writeheader(ino);
bcopy((caddr_t)dp->di_shortlink, buf, memmove(buf, dp->di_shortlink, (u_long)dp->di_size);
(u_long)dp->di_size);
buf[dp->di_size] = '\0'; buf[dp->di_size] = '\0';
writerec(buf, 0); writerec(buf, 0);
return; return;
@ -418,7 +417,7 @@ dmpindir(ino, blk, ind_level, size)
if (blk != 0) if (blk != 0)
bread(fsbtodb(sblock, blk), (char *)idblk, (int) sblock->fs_bsize); bread(fsbtodb(sblock, blk), (char *)idblk, (int) sblock->fs_bsize);
else else
bzero((char *)idblk, (int)sblock->fs_bsize); memset(idblk, 0, (int)sblock->fs_bsize);
if (ind_level <= 0) { if (ind_level <= 0) {
if (*size < NINDIR(sblock) * sblock->fs_bsize) if (*size < NINDIR(sblock) * sblock->fs_bsize)
cnt = howmany(*size, sblock->fs_fsize); cnt = howmany(*size, sblock->fs_fsize);
@ -592,7 +591,7 @@ bread(blkno, buf, size)
/* /*
* Zero buffer, then try to read each sector of buffer separately. * Zero buffer, then try to read each sector of buffer separately.
*/ */
bzero(buf, size); memset(buf, 0, size);
for (i = 0; i < size; i += dev_bsize, buf += dev_bsize, blkno++) { for (i = 0; i < size; i += dev_bsize, buf += dev_bsize, blkno++) {
if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) != if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) !=
((off_t)blkno << dev_bshift)) ((off_t)blkno << dev_bshift))