diff options
author | Toomas Soome <tsoome@me.com> | 2020-05-21 14:11:14 +0300 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2021-03-12 08:56:06 +0200 |
commit | e0dfa398a76c38cdf3380b38117ee2d1ed3249f0 (patch) | |
tree | 2eaed53ef2ddf332d4d146c2fd9b576ecef6ba06 | |
parent | 3a4671b6f0da381fd0891bf9fe1fcb82176d9897 (diff) | |
download | illumos-joyent-e0dfa398a76c38cdf3380b38117ee2d1ed3249f0.tar.gz |
13525 backup: multiply-defined symbols
Reviewed by: C Fraire <cfraire@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/cmd/backup/dump/dump.h | 160 | ||||
-rw-r--r-- | usr/src/cmd/backup/dump/dumpitime.c | 81 | ||||
-rw-r--r-- | usr/src/cmd/backup/dump/dumpmain.c | 39 | ||||
-rw-r--r-- | usr/src/cmd/backup/dump/dumponline.c | 62 | ||||
-rw-r--r-- | usr/src/cmd/backup/dump/dumpoptr.c | 48 | ||||
-rw-r--r-- | usr/src/cmd/backup/dump/dumptape.c | 174 | ||||
-rw-r--r-- | usr/src/cmd/backup/dump/dumptraverse.c | 89 | ||||
-rw-r--r-- | usr/src/cmd/backup/dump/partial.c | 48 | ||||
-rw-r--r-- | usr/src/cmd/backup/restore/dirs.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/backup/restore/restore.h | 2 | ||||
-rw-r--r-- | usr/src/cmd/backup/restore/tape.c | 9 | ||||
-rw-r--r-- | usr/src/head/protocols/dumprestore.h | 2 |
12 files changed, 265 insertions, 451 deletions
diff --git a/usr/src/cmd/backup/dump/dump.h b/usr/src/cmd/backup/dump/dump.h index 3c8703206d..ea56a8e022 100644 --- a/usr/src/cmd/backup/dump/dump.h +++ b/usr/src/cmd/backup/dump/dump.h @@ -93,89 +93,89 @@ extern "C" { #define BIC(i, w) (MWORD(w, i) &= ~MBIT(i)) #define BIT(i, w) (MWORD(w, i) & MBIT(i)) -uint_t msiz; -uchar_t *clrmap; -uchar_t *dirmap; -uchar_t *filmap; -uchar_t *nodmap; -uchar_t *shamap; -uchar_t *activemap; +extern uint_t msiz; +extern uchar_t *clrmap; +extern uchar_t *dirmap; +extern uchar_t *filmap; +extern uchar_t *nodmap; +extern uchar_t *shamap; +extern uchar_t *activemap; /* * All calculations done in 0.1" units! */ -char *disk; /* name of the disk file */ -char *dname; /* name to put in /etc/dumpdates */ -int disk_dynamic; /* true if disk refers to dynamic storage */ -char *tape; /* name of the tape file */ -char *host; /* name of the remote tape host (may be "user@host") */ -char *dumpdev; /* hostname:device for current volume */ -char *sdumpdev; /* short form of dumpdev (no user name if remote) */ -char *increm; /* name of file containing incremental information */ -char *filesystem; /* name of the file system */ -char *myname; /* argv[0] without leading path components */ -char lastincno; /* increment number of previous dump */ -char incno; /* increment number */ -char *tlabel; /* what goes in tape header c_label field */ -int uflag; /* update flag */ -int fi; /* disk file descriptor */ -int to; /* tape file descriptor */ -int mapfd; /* block disk device descriptor for mmap */ -int pipeout; /* true => output to standard output */ -int tapeout; /* true => output to a tape drive */ -ino_t ino; /* current inumber; used globally */ -off_t pos; /* starting offset within ino; used globally */ -int leftover; /* number of tape recs left over from prev vol */ -int nsubdir; /* counts subdirs, for deciding to dump a dir */ -int newtape; /* new tape flag */ -int nadded; /* number of added sub directories */ -int dadded; /* directory added flag */ -int density; /* density in 0.1" units */ -ulong_t tsize; /* tape size in 0.1" units */ -u_offset_t esize; /* estimated tape size, blocks */ -u_offset_t o_esize; /* number of header blocks (overhead) */ -u_offset_t f_esize; /* number of TP_BSIZE blocks for files/maps */ -uint_t etapes; /* estimated number of tapes */ -uint_t ntrec; /* 1K records per tape block */ -int tenthsperirg; /* 1/10" per tape inter-record gap */ -dev_t partial_dev; /* id of BLOCK device used in partial mode */ -pid_t dumppid; /* process-ID of top-level process */ - -int verify; /* verify each volume */ -int doingverify; /* true => doing a verify pass */ -int active; /* recopy active files */ -int doingactive; /* true => redumping active files */ -int archive; /* true => saving a archive in archivefile */ -char *archivefile; /* name of archivefile */ -int archive_opened; /* have opened/created the archivefile */ -int notify; /* notify operator flag */ -int diskette; /* true if dumping to a diskette */ -int cartridge; /* true if dumping to a cartridge tape */ -uint_t tracks; /* number of tracks on a cartridge tape */ -int printsize; /* just print estimated size and exit */ -int offline; /* take tape offline after rewinding */ -int autoload; /* wait for next tape to autoload; implies offline */ -int autoload_tries; /* number of times to check on autoload */ -int autoload_period; /* seconds, tries*period = total wait time */ -int doposition; /* move to specified... */ -daddr32_t filenum; /* position of dump on 1st volume */ -int dumpstate; /* dump output state (see below) */ -int dumptoarchive; /* mark records to be archived */ - -int blockswritten; /* number of blocks written on current tape */ -uint_t tapeno; /* current tape number */ - -struct fs *sblock; /* the file system super block */ -int shortmeta; /* current file has small amount of metadata */ -union u_shadow c_shadow_save[1]; - -time_t *telapsed; /* time spent writing previous tapes */ -time_t *tstart_writing; /* when we started writing the latest tape */ -time_t *tschedule; /* when next to give a remaining-time estimate */ - -char *debug_chdir; /* non-NULL means to mkdir this/pid, and chdir there, */ - /* once for each separate child */ +extern char *disk; /* name of the disk file */ +extern char *dname; /* name to put in /etc/dumpdates */ +extern int disk_dynamic; /* true if disk refers to dynamic storage */ +extern char *tape; /* name of the tape file */ +extern char *host; /* name of the remote tape host (may be "user@host") */ +extern char *dumpdev; /* hostname:device for current volume */ +extern char *sdumpdev; /* short form of dumpdev (no user name if remote) */ +extern char *increm; /* name of file containing incremental information */ +extern char *filesystem; /* name of the file system */ +extern char *myname; /* argv[0] without leading path components */ +extern char lastincno; /* increment number of previous dump */ +extern char incno; /* increment number */ +extern char *tlabel; /* what goes in tape header c_label field */ +extern int uflag; /* update flag */ +extern int fi; /* disk file descriptor */ +extern int to; /* tape file descriptor */ +extern int mapfd; /* block disk device descriptor for mmap */ +extern int pipeout; /* true => output to standard output */ +extern int tapeout; /* true => output to a tape drive */ +extern ino_t ino; /* current inumber; used globally */ +extern off_t pos; /* starting offset within ino; used globally */ +extern int leftover; /* number of tape recs left over from prev vol */ +extern int nsubdir; /* counts subdirs, for deciding to dump a dir */ +extern int newtape; /* new tape flag */ +extern int nadded; /* number of added sub directories */ +extern int dadded; /* directory added flag */ +extern int density; /* density in 0.1" units */ +extern ulong_t tsize; /* tape size in 0.1" units */ +extern u_offset_t esize; /* estimated tape size, blocks */ +extern u_offset_t o_esize; /* number of header blocks (overhead) */ +extern u_offset_t f_esize; /* number of TP_BSIZE blocks for files/maps */ +extern uint_t etapes; /* estimated number of tapes */ +extern uint_t ntrec; /* 1K records per tape block */ +extern int tenthsperirg; /* 1/10" per tape inter-record gap */ +extern dev_t partial_dev; /* id of BLOCK device used in partial mode */ +extern pid_t dumppid; /* process-ID of top-level process */ + +extern int verify; /* verify each volume */ +extern int doingverify; /* true => doing a verify pass */ +extern int active; /* recopy active files */ +extern int doingactive; /* true => redumping active files */ +extern int archive; /* true => saving a archive in archivefile */ +extern char *archivefile; /* name of archivefile */ +extern int archive_opened; /* have opened/created the archivefile */ +extern int notify; /* notify operator flag */ +extern int diskette; /* true if dumping to a diskette */ +extern int cartridge; /* true if dumping to a cartridge tape */ +extern uint_t tracks; /* number of tracks on a cartridge tape */ +extern int printsize; /* just print estimated size and exit */ +extern int offline; /* take tape offline after rewinding */ +extern int autoload; /* wait for next tape to autoload; implies offline */ +extern int autoload_tries; /* number of times to check on autoload */ +extern int autoload_period; /* seconds, tries*period = total wait time */ +extern int doposition; /* move to specified... */ +extern daddr32_t filenum; /* position of dump on 1st volume */ +extern int dumpstate; /* dump output state (see below) */ +extern int dumptoarchive; /* mark records to be archived */ + +extern int blockswritten; /* number of blocks written on current tape */ +extern uint_t tapeno; /* current tape number */ + +extern struct fs *sblock; /* the file system super block */ +extern int shortmeta; /* current file has small amount of metadata */ +extern union u_shadow c_shadow_save[1]; + +extern time_t *telapsed; /* time spent writing previous tapes */ +extern time_t *tstart_writing; /* when we started writing the latest tape */ +extern time_t *tschedule; /* when next to give a remaining-time estimate */ + +extern char *debug_chdir; /* non-NULL means to mkdir this/pid, */ + /* and chdir there, once for each separate child */ /* * Defines for the msec part of @@ -232,8 +232,8 @@ struct idates { time32_t id_ddate; }; -size_t nidates; /* number of records (might be zero) */ -struct idates **idatev; /* the arrayfied version */ +extern size_t nidates; /* number of records (might be zero) */ +extern struct idates **idatev; /* the arrayfied version */ #define ITITERATE(i, ip) \ for (i = 0; i < nidates && (ip = idatev[i]) != NULL; i++) diff --git a/usr/src/cmd/backup/dump/dumpitime.c b/usr/src/cmd/backup/dump/dumpitime.c index 41ba0e0d16..e5f4b32441 100644 --- a/usr/src/cmd/backup/dump/dumpitime.c +++ b/usr/src/cmd/backup/dump/dumpitime.c @@ -12,18 +12,27 @@ * specifies the terms and conditions for redistribution. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "dump.h" #ifndef LOCK_EX -static struct flock fl; +static struct flock fl; #define flock(fd, flag) (fl.l_type = (flag), fcntl(fd, F_SETLKW, &fl)) #define LOCK_EX F_WRLCK #define LOCK_SH F_RDLCK #define LOCK_UN F_UNLCK #endif +char *disk; +char *dname; +char *increm; + +char incno; +char lastincno; +int uflag; +uint_t msiz; +u_offset_t o_esize; +u_offset_t f_esize; + /* * Print a date. A date of 0 is the beginning of time (the "epoch"). * If the 2nd argument is non-zero, it is ok to format the date in @@ -32,8 +41,7 @@ static struct flock fl; * locale-independent. */ char * -prdate(d) - time_t d; +prdate(time_t d) { static char buf[256]; struct tm *tm; @@ -71,11 +79,7 @@ static int makeidate(); #endif void -#ifdef __STDC__ inititimes(void) -#else -inititimes() -#endif { FILE *df; int saverr; @@ -98,10 +102,10 @@ inititimes() if (errno == ENOENT) msg(gettext( "Warning - dump record file `%s' does not exist\n"), - increm); + increm); else { msg(gettext("Cannot open dump record file `%s': %s\n"), - increm, strerror(saverr)); + increm, strerror(saverr)); dumpabort(); /*NOTREACHED*/ } @@ -119,8 +123,7 @@ inititimes() } static void -readitimes(df) - FILE *df; +readitimes(FILE *df) { struct idates *idp; @@ -141,11 +144,7 @@ readitimes(df) } void -#ifdef __STDC__ getitime(void) -#else -getitime() -#endif { struct idates *ip; int i; @@ -164,7 +163,7 @@ getitime() /* XGETTEXT: #ifdef FDEBUG only */ msg(gettext("Looking for name %s in increm = %s for delta = %c\n"), - fname, increm, (uchar_t)incno); + fname, increm, (uchar_t)incno); #endif spcl.c_ddate = 0; lastincno = '0'; @@ -189,11 +188,7 @@ getitime() } void -#ifdef __STDC__ putitime(void) -#else -putitime() -#endif { FILE *df; struct idates *itwalk; @@ -232,7 +227,7 @@ putitime() if (fseek(df, 0L, 0) < 0) { /* rewind() was redefined in dumptape.c */ saverr = errno; msg(gettext("%s: %s error:\n"), - increm, "fseek", strerror(saverr)); + increm, "fseek", strerror(saverr)); dumpabort(); /*NOTREACHED*/ } @@ -240,7 +235,7 @@ putitime() /* LINTED: won't dereference idatev if it is NULL (see readitimes) */ ITITERATE(i, itwalk) { if (strncmp(fname, itwalk->id_name, - sizeof (itwalk->id_name)) != 0) + sizeof (itwalk->id_name)) != 0) continue; if (itwalk->id_incno != incno) continue; @@ -251,7 +246,7 @@ putitime() */ nidates++; idatev = (struct idates **)xrealloc((void *)idatev, - nidates * (size_t)sizeof (struct idates *)); + nidates * (size_t)sizeof (struct idates *)); itwalk = idatev[nidates - 1] = (struct idates *)xcalloc(1, sizeof (*itwalk)); found: @@ -276,22 +271,16 @@ found: } static void -recout(file, what) - FILE *file; - struct idates *what; +recout(FILE *file, struct idates *what) { time_t ddate = what->id_ddate; /* must use ctime, so we can later use unctime() */ - (void) fprintf(file, DUMPOUTFMT, - what->id_name, - (uchar_t)what->id_incno, - ctime(&ddate)); + (void) fprintf(file, DUMPOUTFMT, what->id_name, + (uchar_t)what->id_incno, ctime(&ddate)); } static int -getrecord(df, idatep) - FILE *df; - struct idates *idatep; +getrecord(FILE *df, struct idates *idatep) { char buf[BUFSIZ]; @@ -301,7 +290,7 @@ getrecord(df, idatep) if (makeidate(idatep, buf) < 0) { msg(gettext( "Malformed entry in dump record file `%s', line %d\n"), - increm, recno); + increm, recno); if (strcmp(increm, NINCREM)) { msg(gettext("`%s' not a dump record file\n"), increm); dumpabort(); @@ -312,17 +301,15 @@ getrecord(df, idatep) #ifdef FDEBUG msg("getrecord: %s %c %s\n", - idatep->id_name, - (uchar_t)idatep->id_incno, - prdate(idatep->id_ddate)); + idatep->id_name, + (uchar_t)idatep->id_incno, + prdate(idatep->id_ddate)); #endif return (0); } static int -makeidate(ip, buf) - struct idates *ip; - char *buf; +makeidate(struct idates *ip, char *buf) { char un_buf[128]; /* size must be >= second one in DUMPINFMT */ @@ -354,8 +341,7 @@ makeidate(ip, buf) * hence the estimate may be high. */ void -est(ip) - struct dinode *ip; +est(struct dinode *ip) { u_offset_t s, t; @@ -382,16 +368,15 @@ est(ip) /* calculate the number of indirect blocks on the dump tape */ /* LINTED: spurious complaint sign-extending 32 to 64 bits */ s += d_howmany(t - - (unsigned)(NDADDR * sblock->fs_bsize / tp_bsize), - (unsigned)TP_NINDIR); + (unsigned)(NDADDR * sblock->fs_bsize / tp_bsize), + (unsigned)TP_NINDIR); } f_esize += s; } /*ARGSUSED*/ void -bmapest(map) - uchar_t *map; +bmapest(uchar_t *map) { o_esize++; /* LINTED: spurious complaint sign-extending 32 to 64 bits */ diff --git a/usr/src/cmd/backup/dump/dumpmain.c b/usr/src/cmd/backup/dump/dumpmain.c index b7bb15a963..1d256e298b 100644 --- a/usr/src/cmd/backup/dump/dumpmain.c +++ b/usr/src/cmd/backup/dump/dumpmain.c @@ -41,6 +41,45 @@ #include "roll_log.h" #include <unistd.h> +char *filesystem; +char *host; +char *debug_chdir; +char *dumpdev; +char *sdumpdev; +char *tlabel; +time_t *telapsed; +time_t *tstart_writing; + +uchar_t *clrmap; +uchar_t *dirmap; +uchar_t *filmap; +uchar_t *nodmap; +uchar_t *shamap; +uchar_t *activemap; + +int archive; +int autoload; +int autoload_period; +int autoload_tries; +int archive_opened; +int doingverify; +int disk_dynamic; +int dumpstate; +int dumptoarchive; +int fi; +int leftover; +int nadded; +int offline; +int verify; + +uint_t etapes; +ulong_t tsize; +ino_t ino; +off_t pos; +pid_t dumppid; +u_offset_t esize; +union u_shadow c_shadow_save[1]; + int notify = 0; /* notify operator flag */ int blockswritten = 0; /* number of blocks written on current tape */ uint_t tapeno = 0; /* current tape number */ diff --git a/usr/src/cmd/backup/dump/dumponline.c b/usr/src/cmd/backup/dump/dumponline.c index 5f5155e721..0928318120 100644 --- a/usr/src/cmd/backup/dump/dumponline.c +++ b/usr/src/cmd/backup/dump/dumponline.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "dump.h" #include <math.h> #include <limits.h> @@ -41,6 +39,19 @@ struct inodesc { struct inodesc *id_next; /* next on linked list */ }; +char *archivefile; +char *tape; + +int active; +int doingactive; +int doposition; +int pipeout; +int tapeout; +int to; + +struct fs *sblock; +union u_spcl u_spcl; + static struct inodesc ilist; /* list of used inodesc structs */ static struct inodesc *last; /* last inodesc init'd or matched */ static struct inodesc *freeinodesc; /* free list of inodesc structs */ @@ -56,11 +67,7 @@ static jmp_buf truncate_buf; static void (*savebus)(); static int incopy; -#ifdef __STDC__ static void onsigbus(int); -#else -static void onsigbus(); -#endif #endif /* ENABLE_MMAP */ @@ -70,8 +77,7 @@ extern int xflag; #ifdef ENABLE_MMAP /* XXX part of mmap support */ static void -onsigbus(sig) - int sig; +onsigbus(int sig) { if (!incopy) { dumpabort(); @@ -84,11 +90,7 @@ onsigbus(sig) #endif /* ENABLE_MMAP */ void -#ifdef __STDC__ allocino(void) -#else -allocino() -#endif { ino_t maxino; size_t nused; @@ -116,11 +118,7 @@ allocino() } void -#ifdef __STDC__ freeino(void) -#else -freeino() -#endif { int i; @@ -134,8 +132,7 @@ freeino() } void -resetino(ino) - ino_t ino; +resetino(ino_t ino) { last = ilist.id_next; while (last && last->id_inumber < ino) @@ -143,8 +140,7 @@ resetino(ino) } char * -unrawname(cp) - char *cp; +unrawname(char *cp) { char *dp; extern char *getfullblkname(); @@ -168,9 +164,7 @@ unrawname(cp) * 0 if not mounted, -1 on error. */ int -lf_ismounted(devname, dirname) - char *devname; /* name of device (raw or block) */ - char *dirname; /* name of f/s mount point */ +lf_ismounted(char *devname, char *dirname) { struct stat64 st; char *blockname; /* name of block device */ @@ -218,11 +212,7 @@ static size_t mapsize; /* amount of mapped data */ * constraints. */ caddr_t -mapfile(fd, offset, bytes, fetch) - int fd; - off_t offset; /* offset within file */ - off_t bytes; /* number of bytes to map */ - int fetch; /* start faulting in pages */ +mapfile(int fd, off_t offset, off_t bytes, int fetch) { /*LINTED [c used during pre-fetch faulting]*/ volatile char c, *p; @@ -257,7 +247,7 @@ mapfile(fd, offset, bytes, fetch) if (mapbase == (caddr_t)-1) { saverr = errno; msg(gettext("Cannot map file at inode `%lu' into memory: %s\n"), - ino, strerror(saverr)); + ino, strerror(saverr)); /* XXX why not call dumpailing() here? */ if (!query(gettext( "Do you want to attempt to continue? (\"yes\" or \"no\") "))) { @@ -293,18 +283,14 @@ mapfile(fd, offset, bytes, fetch) else /* XGETTEXT: #ifdef DEBUG only */ msg(gettext( - "FILE TRUNCATED (fault): Interrupting pre-fetch\n")); + "FILE TRUNCATED (fault): Interrupting pre-fetch\n")); #endif (void) signal(SIGBUS, savebus); return (mapstart); } void -#ifdef __STDC__ unmapfile(void) -#else -unmapfile() -#endif { if (mapbase) { /* XXX we're unmapping it, so what does this gain us? */ @@ -316,11 +302,7 @@ unmapfile() #endif /* ENABLE_MMAP */ void -#ifdef __STDC__ activepass(void) -#else -activepass() -#endif { static int passno = 1; /* active file pass number */ char *ext, *old; @@ -374,8 +356,8 @@ activepass() * Be nice and switch volumes. */ (void) snprintf(buf, sizeof (buf), gettext( - "Warning - cannot dump active files to rewind device `%s'\n"), - tape); + "Warning - cannot dump active files to rewind " + "device `%s'\n"), tape); msg(buf); close_rewind(); changevol(); diff --git a/usr/src/cmd/backup/dump/dumpoptr.c b/usr/src/cmd/backup/dump/dumpoptr.c index dfab108605..631a494993 100644 --- a/usr/src/cmd/backup/dump/dumpoptr.c +++ b/usr/src/cmd/backup/dump/dumpoptr.c @@ -12,21 +12,15 @@ * specifies the terms and conditions for redistribution. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <errno.h> #include "dump.h" +time_t *tschedule; static unsigned int timeout; /* current timeout */ static char *attnmessage, *saveattn; /* attention message */ -#ifdef __STDC__ static void alarmcatch(); static int idatesort(const void *, const void *); -#else /* !__STDC__ */ -static void alarmcatch(); -static int idatesort(); -#endif #ifdef DEBUG extern int xflag; @@ -44,8 +38,7 @@ extern int xflag; * that dump needs attention. */ int -query(question) - char *question; +query(char *question) { int def = -1; @@ -59,8 +52,7 @@ static jmp_buf sjalarmbuf; /* real simple check-sum */ static int -addem(s) - char *s; +addem(char *s) { int total = 0; @@ -72,9 +64,7 @@ addem(s) } int -query_once(question, def) - char *question; - int def; +query_once(char *question, int def) { static char *lastmsg; static int lastmsgsum; @@ -187,11 +177,7 @@ done: * longjmp back there and return the default answer. */ static void -#ifdef __STDC__ alarmcatch(void) -#else -alarmcatch() -#endif { struct sigvec sv; @@ -216,8 +202,7 @@ alarmcatch() */ /*ARGSUSED*/ void -interrupt(sig) - int sig; +interrupt(int sig) { if (!saveattn) { saveattn = attnmessage; @@ -243,8 +228,7 @@ interrupt(sig) * controlling terminals, and the like. */ void -broadcast(message) - char *message; +broadcast(char *message) { time_t clock; pid_t pid; @@ -308,9 +292,7 @@ broadcast(message) */ #define EST_SEC 600 /* every 10 minutes */ void -timeest(force, blkswritten) - int force; - int blkswritten; +timeest(int force, int blkswritten) { time_t tnow, deltat; char *msgp; @@ -325,10 +307,10 @@ timeest(force, blkswritten) if (!force && blkswritten < 50 * ntrec) return; deltat = (*telapsed + (tnow - *tstart_writing)) - * ((double)esize / blkswritten - 1.0); + * ((double)esize / blkswritten - 1.0); msgp = gettext("%3.2f%% done, finished in %d:%02d\n"); msg(msgp, (blkswritten*100.0)/esize, - deltat/3600, (deltat%3600)/60); + deltat/3600, (deltat%3600)/60); } } @@ -377,8 +359,7 @@ msgtail(const char *fmt, ...) * we don't actually do it */ void -lastdump(arg) /* w ==> just what to do; W ==> most recent dumps */ - int arg; +lastdump(int arg) /* w ==> just what to do; W ==> most recent dumps */ { char *lastname; char *date; @@ -445,14 +426,7 @@ lastdump(arg) /* w ==> just what to do; W ==> most recent dumps */ } static int -idatesort(v1, v2) -#ifdef __STDC__ - const void *v1; - const void *v2; -#else - void *v1; - void *v2; -#endif +idatesort(const void *v1, const void *v2) { struct idates **p1 = (struct idates **)v1; struct idates **p2 = (struct idates **)v2; diff --git a/usr/src/cmd/backup/dump/dumptape.c b/usr/src/cmd/backup/dump/dumptape.c index 39f09b35a7..d64fe63717 100644 --- a/usr/src/cmd/backup/dump/dumptape.c +++ b/usr/src/cmd/backup/dump/dumptape.c @@ -41,6 +41,7 @@ #define SLEEPMS 50 +int newtape; static uint_t writesize; /* size of malloc()ed buffer for tape */ static ino_t inos[TP_NINOS]; /* starting inodes on each tape */ @@ -153,7 +154,6 @@ int caught; /* caught signal -- imported by mapfile() */ extern int xflag; #endif -#ifdef __STDC__ static void cmdwrterr(void); static void cmdrderr(void); static void freetape(void); @@ -176,30 +176,6 @@ static void onxfsz(int); static void dowrite(int); static void checkpoint(struct bdesc *, int); static ssize_t atomic(int (*)(), int, char *, int); -#else -static void cmdwrterr(); -static void cmdrderr(); -static void freetape(); -static void bufclear(); -static pid_t setuparchive(); -static pid_t setupwriter(); -static void nextslave(); -static void tperror(); -static void rollforward(); -static void nap(); -static void alrm(); -static void just_rewind(); -static void killall(); -static void proceed(); -static void die(); -static void enslave(); -static void wait_our_turn(); -static void dumpoffline(); -static void onxfsz(); -static void dowrite(); -static void checkpoint(); -static ssize_t atomic(); -#endif static size_t tapesize; @@ -208,9 +184,6 @@ static size_t tapesize; * allocated on page boundaries for tape write() efficiency. */ void -#ifdef __STDC__ -#else -#endif alloctape(void) { struct slaves *slavep; @@ -223,7 +196,7 @@ alloctape(void) writesize = ntrec * tp_bsize; if (!printsize) msg(gettext("Writing %d Kilobyte records\n"), - writesize / TP_BSIZE_MIN); + writesize / TP_BSIZE_MIN); /* * set up shared memory seg for here and child @@ -232,7 +205,7 @@ alloctape(void) if (mapfd == -1) { saverr = errno; msg(gettext("Cannot open `%s': %s\n"), - "/dev/zero", strerror(saverr)); + "/dev/zero", strerror(saverr)); dumpabort(); /*NOTREACHED*/ } @@ -312,11 +285,7 @@ alloctape(void) } static void -#ifdef __STDC__ freetape(void) -#else -freetape() -#endif { if (shared == NULL) return; @@ -330,11 +299,7 @@ freetape() * before a pass to dump active files. */ void -#ifdef __STDC__ reset(void) -#else -reset() -#endif { bufclear(); @@ -355,11 +320,7 @@ reset() } static void -#ifdef __STDC__ bufclear(void) -#else -bufclear() -#endif { struct bdesc *bp; int i; @@ -377,7 +338,7 @@ bufclear() (*current < &bufp[0] || *current > &bufp[NBUF*ntrec])) { /* ANSI string catenation, to shut cstyle up */ msg(gettext("bufclear: current buffer pointer (0x%x) " - "out of range of buffer\naddresses (0x%x - 0x%x)\n"), + "out of range of buffer\naddresses (0x%x - 0x%x)\n"), *current, &bufp[0], &bufp[NBUF*ntrec]); dumpabort(); /*NOTREACHED*/ @@ -430,7 +391,7 @@ setuparchive(void) if (lseek64(archivefd, lf_archoffset, 0) < 0) { saverr = errno; msg(gettext( - "Cannot position archive file `%s' : %s\n"), + "Cannot position archive file `%s' : %s\n"), archivefile, strerror(saverr)); dumpabort(); /*NOTREACHED*/ @@ -438,7 +399,7 @@ setuparchive(void) if (ftruncate64(archivefd, lf_archoffset) < 0) { saverr = errno; msg(gettext( - "Cannot truncate archive file `%s' : %s\n"), + "Cannot truncate archive file `%s' : %s\n"), archivefile, strerror(saverr)); dumpabort(); /*NOTREACHED*/ @@ -509,7 +470,7 @@ setuparchive(void) } if (fstat64(archivefd, &stats) < 0) - stats.st_size = -1; + stats.st_size = -1; /* cast to keep lint&printf happy */ msg(gettext( @@ -557,14 +518,14 @@ setupwriter(void) if (pipe(cmd) < 0) { saverr = errno; msg(gettext("%s: %s error: %s\n"), - "setupwriter", "pipe", strerror(saverr)); + "setupwriter", "pipe", strerror(saverr)); return (0); } sighold(SIGINT); if ((pid = fork()) < 0) { saverr = errno; msg(gettext("%s: %s error: %s\n"), - "setupwriter", "fork", strerror(saverr)); + "setupwriter", "fork", strerror(saverr)); return (0); } if (pid > 0) { @@ -608,11 +569,7 @@ setupwriter(void) } void -#ifdef __STDC__ spclrec(void) -#else -spclrec() -#endif { int s, i; int32_t *ip; @@ -742,9 +699,9 @@ tperror(int sig) if (tapeout && (isrewind(to) || offline)) { /* ANSI string catenation, to shut cstyle up */ msg(gettext("This tape will rewind. After " - "it is rewound,\nreplace the faulty tape " - "with a new one;\nthis dump volume will " - "be rewritten.\n")); + "it is rewound,\nreplace the faulty tape " + "with a new one;\nthis dump volume will " + "be rewritten.\n")); } } else { broadcast(gettext("TAPE VERIFICATION ERROR!\n")); @@ -755,7 +712,7 @@ tperror(int sig) /*NOTREACHED*/ } msg(gettext( - "This tape will be rewritten and then verified\n")); + "This tape will be rewritten and then verified\n")); } killall(); trewind(); @@ -784,8 +741,9 @@ toslave(void (*fn)(), ino_t inumber) if (wasactive) { active++; msg(gettext( - "The file at inode `%lu' was active and will be recopied\n"), - slp->sl_req->ir_inumber); + "The file at inode `%lu' was active and will " + "be recopied\n"), + slp->sl_req->ir_inumber); /* LINTED: 32-bit to 8-bit assignment ok */ BIS(slp->sl_req->ir_inumber, activemap); } @@ -818,11 +776,7 @@ dospcl(ino_t inumber) } static void -#ifdef __STDC__ nextslave(void) -#else -nextslave() -#endif { if (++rotor >= SLAVES) { rotor = 0; @@ -831,11 +785,7 @@ nextslave() } void -#ifdef __STDC__ flushcmds(void) -#else -flushcmds() -#endif { int i; int wasactive; @@ -859,7 +809,7 @@ flushcmds() active++; msg(gettext( "inode %d was active and will be recopied\n"), - slp->sl_req->ir_inumber); + slp->sl_req->ir_inumber); /* LINTED: 32-bit to 8-bit assignment ok */ BIS(slp->sl_req->ir_inumber, activemap); } @@ -868,11 +818,7 @@ flushcmds() } void -#ifdef __STDC__ flusht(void) -#else -flusht() -#endif { sigset_t block_set, oset; /* hold SIGUSR1 and atomically sleep */ @@ -973,7 +919,7 @@ rollforward(int sig) if (lf_archoffset < 0) { int saverr = errno; msg(gettext("Cannot position archive file `%s': %s\n"), - archivefile, strerror(saverr)); + archivefile, strerror(saverr)); dumpabort(); /*NOTREACHED*/ } @@ -984,7 +930,7 @@ rollforward(int sig) if (dumpstate == DS_START) { msg(gettext( - "Tape too short: changing volumes and restarting\n")); + "Tape too short: changing volumes and restarting\n")); reset(); } @@ -1024,11 +970,7 @@ alrm(int sig) } void -#ifdef __STDC__ nextdevice(void) -#else -nextdevice() -#endif { char *cp; @@ -1112,7 +1054,7 @@ isrewind(int f) if (fstat64(f, &sbuf) < 0) { msg(gettext( "Cannot obtain status of output device `%s'\n"), - tape); + tape); dumpabort(); /*NOTREACHED*/ } @@ -1122,11 +1064,7 @@ isrewind(int f) } static void -#ifdef __STDC__ just_rewind(void) -#else -just_rewind() -#endif { struct slaves *slavep; char *rewinding = gettext("Tape rewinding\n"); @@ -1179,11 +1117,7 @@ just_rewind() } void -#ifdef __STDC__ trewind(void) -#else -trewind() -#endif { (void) timeclock((time_t)0); if (offline && (!verify || doingverify)) { @@ -1200,11 +1134,7 @@ trewind() } void -#ifdef __STDC__ close_rewind(void) -#else -close_rewind() -#endif { char *rewinding = gettext("Tape rewinding\n"); @@ -1238,11 +1168,7 @@ close_rewind() } void -#ifdef __STDC__ changevol(void) -#else -changevol() -#endif { char buf1[3000], buf2[3000]; char volname[LBLSIZE+1]; @@ -1408,7 +1334,7 @@ restore_check_point: if (childpid < 0) { msg(gettext( "Context-saving fork failed in parent %ld\n"), - (long)parentpid); + (long)parentpid); Exit(X_ABORT); } if (childpid != 0) { @@ -1426,7 +1352,7 @@ restore_check_point: /* XGETTEXT: #ifdef TDEBUG only */ msg(gettext( "Volume: %d; parent process: %ld child process %ld\n"), - tapeno+1, (long)parentpid, (long)childpid); + tapeno+1, (long)parentpid, (long)childpid); #endif /* TDEBUG */ for (;;) { waitproc = waitpid(0, &status, 0); @@ -1523,7 +1449,7 @@ restore_check_point: /* XGETTEXT: #ifdef TDEBUG only */ msg(gettext( "Child on Volume %d has parent %ld, my pid = %ld\n"), - tapeno+1, (long)parentpid, (long)getpid()); + tapeno+1, (long)parentpid, (long)getpid()); #endif (void) snprintf(buf, sizeof (buf), gettext( "Cannot open `%s'. Do you want to retry the open?: (\"yes\" or \"no\") "), @@ -1585,10 +1511,11 @@ restore_check_point: * The tape is rewinding; * we're screwed. */ - msg(gettext( - "Cannot position tape using rewind device!\n")); - dumpabort(); - /*NOTREACHED*/ + msg(gettext( + "Cannot position tape using " + "rewind device!\n")); + dumpabort(); + /*NOTREACHED*/ } else { sv.sv_handler = alrm; (void) sigvec(SIGALRM, &sv, &osv); @@ -1670,7 +1597,7 @@ restore_check_point: } else if (tapeno > 1) { msg(gettext( "Volume %d begins with blocks from inode %lu\n"), - tapeno, chkpt.sl_inos); + tapeno, chkpt.sl_inos); } (void) timeclock((time_t)1); (void) time(tstart_writing); @@ -1679,11 +1606,7 @@ restore_check_point: } void -#ifdef __STDC__ dumpabort(void) -#else -dumpabort() -#endif { if (master && master != getpid()) @@ -1723,17 +1646,13 @@ Exit(status) /* XGETTEXT: #ifdef TDEBUG only */ msg(gettext("pid = %ld exits with status %d\n"), - (long)getpid(), status); + (long)getpid(), status); #endif /* TDEBUG */ exit(status); } static void -#ifdef __STDC__ killall(void) -#else -killall() -#endif { struct slaves *slavep; @@ -1744,7 +1663,7 @@ killall() /* XGETTEXT: #ifdef TDEBUG only */ msg(gettext("Slave child %ld killed\n"), - (long)slavep->sl_slavepid); + (long)slavep->sl_slavepid); #endif } if (writepid) { @@ -1780,11 +1699,7 @@ die(int sig) } static void -#ifdef __STDC__ enslave(void) -#else -enslave() -#endif { int cmd[2]; /* file descriptors */ int i; @@ -1871,7 +1786,7 @@ enslave() saverr = errno; msg(gettext( "Cannot open dump device `%s': %s\n"), - disk, strerror(saverr)); + disk, strerror(saverr)); dumpabort(); /*NOTREACHED*/ } @@ -1929,11 +1844,7 @@ enslave() } static void -#ifdef __STDC__ wait_our_turn(void) -#else -wait_our_turn() -#endif { (void) sighold(SIGUSR1); @@ -2108,7 +2019,7 @@ dowrite(int cmd) gettext( "Verification error %ld feet into tape %d\n"), (cartridge ? asize/tracks : - asize)/120L, + asize)/120L, tapeno); else (void) snprintf(buf, sizeof (buf), @@ -2127,7 +2038,7 @@ dowrite(int cmd) gettext( "Write error %ld feet into tape %d\n"), (cartridge ? asize/tracks : - asize)/120L, tapeno); + asize)/120L, tapeno); else (void) snprintf(buf, sizeof (buf), gettext( @@ -2174,13 +2085,12 @@ dowrite(int cmd) if (sp->s_spcl.c_type != TS_ADDR) { lastnonaddr = sp->s_spcl.c_type; lastnonaddrm = - sp->s_spcl.c_dinode.di_mode; + sp->s_spcl.c_dinode.di_mode; if (sp->s_spcl.c_type != TS_TAPE) chkpt.sl_offset = 0; } chkpt.sl_count = sp->s_spcl.c_count; - bcopy((char *)sp, - (char *)&spcl, sizeof (spcl)); + bcopy((char *)sp, (char *)&spcl, sizeof (spcl)); mp = recmap; endmp = &recmap[spcl.c_count]; count = 0; @@ -2385,11 +2295,7 @@ atomic(int (*func)(), int fd, char *buf, int count) } void -#ifdef __STDC__ -positiontape(char *msgbuf) -#else positiontape(char *msgbuf) -#endif { /* Static as never change, no need to waste stack space */ static struct mtget mt; @@ -2455,22 +2361,14 @@ positiontape(char *msgbuf) } static void -#ifdef __STDC__ cmdwrterr(void) -#else -cmdwrterr() -#endif { int saverr = errno; msg(gettext("Error writing command pipe: %s\n"), strerror(saverr)); } static void -#ifdef __STDC__ cmdrderr(void) -#else -cmdrderr() -#endif { int saverr = errno; msg(gettext("Error reading command pipe: %s\n"), strerror(saverr)); diff --git a/usr/src/cmd/backup/dump/dumptraverse.c b/usr/src/cmd/backup/dump/dumptraverse.c index 4e28e56347..a021386b16 100644 --- a/usr/src/cmd/backup/dump/dumptraverse.c +++ b/usr/src/cmd/backup/dump/dumptraverse.c @@ -12,33 +12,24 @@ * specifies the terms and conditions for redistribution. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "dump.h" #include <sys/file.h> #include <sys/mman.h> -#ifdef __STDC__ static void lf_dmpindir(daddr32_t, int, u_offset_t *); static void indir(daddr32_t, int, u_offset_t *); static void lf_blksout(daddr32_t *, u_offset_t); static void lf_dumpinode(struct dinode *); static void dsrch(daddr32_t, ulong_t, u_offset_t); void lf_dump(struct dinode *); -#else -static void lf_dmpindir(); -static void indir(); -static void lf_blksout(); -static void dsrch(); -void lf_dump(); -#endif +int dadded; +int nsubdir; +int shortmeta; static char msgbuf[256]; void -pass(fn, map) - void (*fn)(struct dinode *); - uchar_t *map; +pass(void (*fn)(struct dinode *), uchar_t *map) { int bits; ino_t maxino; @@ -84,8 +75,7 @@ restart: } void -mark(ip) - struct dinode *ip; +mark(struct dinode *ip) { int f; @@ -118,8 +108,7 @@ mark(ip) } void -active_mark(ip) - struct dinode *ip; +active_mark(struct dinode *ip) { int f; @@ -161,8 +150,7 @@ static struct shcount { static struct shcount *shc = NULL; void -markshad(ip) - struct dinode *ip; +markshad(struct dinode *ip) { ino_t shadow; @@ -195,8 +183,7 @@ markshad(ip) } void -estshad(ip) - struct dinode *ip; +estshad(struct dinode *ip) { u_offset_t esizeprime; u_offset_t tmpesize; @@ -240,8 +227,7 @@ freeshad() } void -add(ip) - struct dinode *ip; +add(struct dinode *ip) { int i; u_offset_t filesize; @@ -292,10 +278,7 @@ add(ip) } static void -indir(d, n, filesize) - daddr32_t d; - int n; - u_offset_t *filesize; +indir(daddr32_t d, int n, u_offset_t *filesize) { int i; daddr32_t idblk[MAXNINDIR]; @@ -344,15 +327,13 @@ blocks than valid maximum.\n")); } void -dirdump(ip) - struct dinode *ip; +dirdump(struct dinode *ip) { /* watchout for dir inodes deleted and maybe reallocated */ if (((ip->di_mode & IFMT) != IFDIR && (ip->di_mode & IFMT) != IFATTRDIR) || ip->di_nlink < 2) { (void) snprintf(msgbuf, sizeof (msgbuf), gettext( - "Warning - directory at inode `%lu' vanished!\n"), - ino); + "Warning - directory at inode `%lu' vanished!\n"), ino); msg(msgbuf); return; } @@ -362,18 +343,16 @@ dirdump(ip) static u_offset_t loffset; /* current offset in file (ufsdump) */ static void -lf_dumpmeta(ip) - struct dinode *ip; +lf_dumpmeta(struct dinode *ip) { if ((ip->di_shadow == 0) || shortmeta) - return; + return; lf_dumpinode(getino((ino_t)(unsigned)(ip->di_shadow))); } int -hasshortmeta(ip) - struct dinode **ip; +hasshortmeta(struct dinode **ip) { ino_t savino; int rc; @@ -388,8 +367,7 @@ hasshortmeta(ip) } void -lf_dumpinode(ip) - struct dinode *ip; +lf_dumpinode(struct dinode *ip) { int i; u_offset_t size; @@ -425,8 +403,7 @@ lf_dumpinode(ip) } void -lf_dump(ip) - struct dinode *ip; +lf_dump(struct dinode *ip) { if ((!BIT(ino, nodmap)) && (!BIT(ino, shamap))) @@ -460,10 +437,7 @@ lf_dump(ip) } static void -lf_dmpindir(blk, lvl, size) - daddr32_t blk; - int lvl; - u_offset_t *size; +lf_dmpindir(daddr32_t blk, int lvl, u_offset_t *size) { int i; u_offset_t cnt; @@ -507,9 +481,7 @@ blocks than valid maximum.\n")); } static void -lf_blksout(blkp, bytes) - daddr32_t *blkp; - u_offset_t bytes; +lf_blksout(daddr32_t *blkp, u_offset_t bytes) { u_offset_t i; u_offset_t tbperfsb = (unsigned)(sblock->fs_bsize / tp_bsize); @@ -620,9 +592,7 @@ lf_blksout(blkp, bytes) } void -bitmap(map, typ) - uchar_t *map; - int typ; +bitmap(uchar_t *map, int typ) { int i; u_offset_t count; @@ -653,10 +623,7 @@ bitmap(map, typ) } static void -dsrch(d, size, filesize) - daddr32_t d; - ulong_t size; /* block size */ - u_offset_t filesize; +dsrch(daddr32_t d, ulong_t size, u_offset_t filesize) { struct direct *dp; struct dinode *ip; @@ -688,8 +655,8 @@ dsrch(d, size, filesize) dp = (struct direct *)(dblk + loc); if (dp->d_reclen == 0) { (void) snprintf(msgbuf, sizeof (msgbuf), gettext( - "Warning - directory at inode `%lu' is corrupted\n"), - ino); + "Warning - directory at inode `%lu' is " + "corrupted\n"), ino); msg(msgbuf); break; } @@ -734,8 +701,7 @@ dsrch(d, size, filesize) #define CACHESIZE 32 struct dinode * -getino(ino) - ino_t ino; +getino(ino_t ino) { static ino_t minino, maxino; static struct dinode itab[MAXINOPB]; @@ -794,10 +760,7 @@ getino(ino) void -bread(da, ba, cnt) -diskaddr_t da; -uchar_t *ba; -size_t cnt; +bread(diskaddr_t da, uchar_t *ba, size_t cnt) { caddr_t maddr; uchar_t *dest; @@ -848,7 +811,7 @@ size_t cnt; } if (read(fi, ba, (size_t)cnt) == (size_t)cnt) - return; + return; while (cnt != 0) { diff --git a/usr/src/cmd/backup/dump/partial.c b/usr/src/cmd/backup/dump/partial.c index 4481a951ad..6194180182 100644 --- a/usr/src/cmd/backup/dump/partial.c +++ b/usr/src/cmd/backup/dump/partial.c @@ -24,32 +24,20 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "dump.h" #include <ftw.h> #include <ulimit.h> +dev_t partial_dev; static int partial; -#ifdef __STDC__ static dev_t devfromopts(struct mntent *); static int lf_mark_root(dev_t, char *); static int lf_ftw_mark(const char *, const struct stat64 *, int); static void markino(ino_t); -#else -static dev_t devfromopts(); -static int lf_mark_root(); -static int lf_ftw_mark(); -static void markino(); -#endif void -#ifdef __STDC__ partial_check(void) -#else -partial_check() -#endif { struct mntent *mnt; struct stat64 st; @@ -92,8 +80,7 @@ partial_check() * extract the device id and avoid having to stat. */ static dev_t -devfromopts(mnt) - struct mntent *mnt; +devfromopts(struct mntent *mnt) { char *str; @@ -105,9 +92,7 @@ devfromopts(mnt) } int -partial_mark(argc, argv) - int argc; - char **argv; +partial_mark(int argc, char **argv) { char *path; struct stat64 st; @@ -119,9 +104,9 @@ partial_mark(argc, argv) path = *argv++; if (stat64(path, &st) < 0 || - st.st_dev != partial_dev) { + st.st_dev != partial_dev) { msg(gettext("`%s' is not on dump device `%s'\n"), - path, disk); + path, disk); dumpabort(); /*NOTREACHED*/ } @@ -139,7 +124,7 @@ partial_mark(argc, argv) < 0) { int saverr = errno; msg(gettext("Error in %s (%s)\n"), - "ftw", strerror(saverr)); + "ftw", strerror(saverr)); dumpabort(); /*NOTREACHED*/ } @@ -150,9 +135,7 @@ partial_mark(argc, argv) /* mark directories between target and root */ static int -lf_mark_root(dev, path) - dev_t dev; - char *path; +lf_mark_root(dev_t dev, char *path) { struct stat64 st; char dotdot[MAXPATHLEN + 16]; @@ -182,8 +165,8 @@ lf_mark_root(dev, path) /* keep marking parent until we hit mount point */ do { if (stat64(dotdot, &st) < 0 || - (st.st_mode & S_IFMT) != S_IFDIR || - st.st_dev != dev) + (st.st_mode & S_IFMT) != S_IFDIR || + st.st_dev != dev) return (1); markino(st.st_ino); if (strlen(dotdot) > (sizeof (dotdot) - 4)) @@ -196,15 +179,7 @@ lf_mark_root(dev, path) /*ARGSUSED*/ static int -lf_ftw_mark(name, st, flag) -#ifdef __STDC__ - const char *name; - const struct stat64 *st; -#else - char *name; - struct stat64 *st; -#endif - int flag; +lf_ftw_mark(const char *name, const struct stat64 *st, int flag) { if (flag != FTW_NS) { /* LINTED ufs only uses the lower 32 bits */ @@ -214,8 +189,7 @@ lf_ftw_mark(name, st, flag) } static void -markino(i) - ino_t i; +markino(ino_t i) { struct dinode *dp; diff --git a/usr/src/cmd/backup/restore/dirs.c b/usr/src/cmd/backup/restore/dirs.c index 566f177c2f..2757f53e46 100644 --- a/usr/src/cmd/backup/restore/dirs.c +++ b/usr/src/cmd/backup/restore/dirs.c @@ -18,6 +18,8 @@ #include <unistd.h> #include <utime.h> +struct context curfile; + /* * Symbol table of directories read from tape. */ diff --git a/usr/src/cmd/backup/restore/restore.h b/usr/src/cmd/backup/restore/restore.h index d1002703b3..807545da9e 100644 --- a/usr/src/cmd/backup/restore/restore.h +++ b/usr/src/cmd/backup/restore/restore.h @@ -171,7 +171,7 @@ typedef struct _rstdirdesc { /* * The entry describes the next file available on the tape */ -struct context { +extern struct context { char *name; /* name of file */ ino_t ino; /* inumber of file */ struct dinode *dip; /* pointer to inode */ diff --git a/usr/src/cmd/backup/restore/tape.c b/usr/src/cmd/backup/restore/tape.c index ac4af20262..cc0ea15b95 100644 --- a/usr/src/cmd/backup/restore/tape.c +++ b/usr/src/cmd/backup/restore/tape.c @@ -43,6 +43,7 @@ static int numtrec; /* # of logical blocks in current tape record */ static char *tbf = NULL; static size_t tbfsize = 0; static int recsread; +union u_spcl u_spcl; static union u_spcl endoftapemark; static struct s_spcl dumpinfo; static long blksread; /* # of logical blocks actually read/touched */ @@ -1233,18 +1234,14 @@ metaset(char *name) } void -metaget(data, size) - char **data; - size_t *size; +metaget(char **data, size_t *size) { *data = metadata; *size = metasize; } static void -fsd_acl(name, aclp, size) - char *name, *aclp; - unsigned size; +fsd_acl(char *name, char *aclp, unsigned size) { static aclent_t *aclent = NULL; ufs_acl_t *diskacl; diff --git a/usr/src/head/protocols/dumprestore.h b/usr/src/head/protocols/dumprestore.h index 29b3b309b7..aa081a3e76 100644 --- a/usr/src/head/protocols/dumprestore.h +++ b/usr/src/head/protocols/dumprestore.h @@ -117,7 +117,7 @@ union u_shadow { /* if you change anything here, be sure to change normspcl in byteorder.c */ -union u_spcl { +extern union u_spcl { char dummy[TP_BUFSIZE]; struct s_spcl { int32_t c_type; /* record type (see below) */ |