Index: sbin/dump/dump.h =================================================================== --- sbin/dump/dump.h +++ sbin/dump/dump.h @@ -33,13 +33,17 @@ * $FreeBSD$ */ +#ifndef EXTERN +#define EXTERN extern +#endif + /* * Dump maps used to describe what is to be dumped. */ -int mapsize; /* size of the state maps */ -char *usedinomap; /* map of allocated inodes */ -char *dumpdirmap; /* map of directories to be dumped */ -char *dumpinomap; /* map of files to be dumped */ +EXTERN int mapsize; /* size of the state maps */ +EXTERN char *usedinomap; /* map of allocated inodes */ +EXTERN char *dumpdirmap; /* map of directories to be dumped */ +EXTERN char *dumpinomap; /* map of files to be dumped */ /* * Map manipulation macros. */ @@ -56,39 +60,42 @@ /* * All calculations done in 0.1" units! */ -char *disk; /* name of the disk file */ -char *tape; /* name of the tape file */ -char *popenout; /* popen(3) per-"tape" command */ -char *dumpdates; /* name of the file containing dump date information*/ -char *temp; /* name of the file for doing rewrite of dumpdates */ -int lastlevel; /* dump level of previous dump */ -int level; /* dump level of this dump */ -int uflag; /* update flag */ -int diskfd; /* disk file descriptor */ -int tapefd; /* tape file descriptor */ -int pipeout; /* true => output to standard output */ -ino_t curino; /* current inumber; used globally */ -int newtape; /* new tape flag */ -int density; /* density in 0.1" units */ -long tapesize; /* estimated tape size, blocks */ -long tsize; /* tape size in 0.1" units */ -long asize; /* number of 0.1" units written on current tape */ -int etapes; /* estimated number of tapes */ -int nonodump; /* if set, do not honor UF_NODUMP user flags */ -int unlimited; /* if set, write to end of medium */ -int cachesize; /* size of block cache in bytes */ -int rsync_friendly; /* be friendly with rsync */ - -int notify; /* notify operator flag */ -int blockswritten; /* number of blocks written on current tape */ -int tapeno; /* current tape number */ -time_t tstart_writing; /* when started writing the first tape block */ -time_t tend_writing; /* after writing the last tape block */ -int passno; /* current dump pass number */ -struct fs *sblock; /* the file system super block */ -long dev_bsize; /* block size of underlying disk device */ -int dev_bshift; /* log2(dev_bsize) */ -int tp_bshift; /* log2(TP_BSIZE) */ +EXTERN char *disk; /* name of the disk file */ +EXTERN char *tape; /* name of the tape file */ +EXTERN char *popenout; /* popen(3) per-"tape" command */ +/* name of the file containing dump date information*/ +EXTERN char *dumpdates; +/* name of the file for doing rewrite of dumpdates */ +EXTERN char *temp; +EXTERN int lastlevel; /* dump level of previous dump */ +EXTERN int level; /* dump level of this dump */ +EXTERN int uflag; /* update flag */ +EXTERN int diskfd; /* disk file descriptor */ +EXTERN int tapefd; /* tape file descriptor */ +EXTERN int pipeout; /* true => output to standard output */ +EXTERN ino_t curino; /* current inumber; used globally */ +EXTERN int newtape; /* new tape flag */ +EXTERN int density; /* density in 0.1" units */ +EXTERN long tapesize; /* estimated tape size, blocks */ +EXTERN long tsize; /* tape size in 0.1" units */ +/* number of 0.1" units written on current tape */ +EXTERN long asize; +EXTERN int etapes; /* estimated number of tapes */ +EXTERN int nonodump; /* if set, do not honor UF_NODUMP user flags */ +EXTERN int unlimited; /* if set, write to end of medium */ +EXTERN int cachesize; /* size of block cache in bytes */ +EXTERN int rsync_friendly; /* be friendly with rsync */ + +EXTERN int notify; /* notify operator flag */ +EXTERN int blockswritten; /* number of blocks written on current tape */ +EXTERN int tapeno; /* current tape number */ +EXTERN time_t tstart_writing; /* when started writing the first tape block */ +EXTERN time_t tend_writing; /* after writing the last tape block */ +EXTERN int passno; /* current dump pass number */ +EXTERN struct fs *sblock; /* the file system super block */ +EXTERN long dev_bsize; /* block size of underlying disk device */ +EXTERN int dev_bshift; /* log2(dev_bsize) */ +EXTERN int tp_bshift; /* log2(TP_BSIZE) */ /* operator interface functions */ void broadcast(const char *message); @@ -163,8 +170,8 @@ int dd_level; time_t dd_ddate; }; -int nddates; /* number of records (might be zero) */ -struct dumpdates **ddatev; /* the arrayfied version */ +EXTERN int nddates; /* number of records (might be zero) */ +EXTERN struct dumpdates **ddatev; /* the arrayfied version */ void initdumptimes(void); void getdumptime(void); void putdumptime(void); Index: sbin/dump/itime.c =================================================================== --- sbin/dump/itime.c +++ sbin/dump/itime.c @@ -60,8 +60,6 @@ SLIST_ENTRY(dumptime) dt_list; }; SLIST_HEAD(dthead, dumptime) dthead = SLIST_HEAD_INITIALIZER(dthead); -struct dumpdates **ddatev = NULL; -int nddates = 0; static void dumprecout(FILE *, const struct dumpdates *); static int getrecord(FILE *, struct dumpdates *); Index: sbin/dump/main.c =================================================================== --- sbin/dump/main.c +++ sbin/dump/main.c @@ -70,6 +70,7 @@ #include #include +#define EXTERN #include "dump.h" #include "pathnames.h" Index: sbin/restore/restore.h =================================================================== --- sbin/restore/restore.h +++ sbin/restore/restore.h @@ -103,7 +103,7 @@ /* * The entry describes the next file available on the tape */ -struct context { +extern struct context { short action; /* action being taken on this file */ mode_t mode; /* mode of file */ ino_t ino; /* inumber of file */ Index: sbin/restore/restore.c =================================================================== --- sbin/restore/restore.c +++ sbin/restore/restore.c @@ -52,6 +52,8 @@ static char *keyval(int); +struct context curfile; + /* * This implements the 't' option. * List entries on the tape.