#include "config.h" // IWYU pragma: keep // IWYU pragma: no_include "dump_globals.h" #include "shared_globals.h" #include #include #include #include #include "compat/include/protocols/dumprestore.h" /* Global variables used by both dump and restore */ int ntrec = NTREC; /* number of TP_BSIZE records per tape block */ int abortifconnerr = 1; /* set to 1 if dumprmt should exit on connection errors otherwise just print a message using msg */ int rshpid = -1; int dokerberos; union u_spcl u_spcl; union u_data u_data; char *usedinomap; /* map of inodes that are in use on this fs */ char *dumpinomap; /* map of inodes on this dump tape */ dump_ino_t volinfo[TP_NINOS]; /* which inode on which volume archive info */ uint32_t dflag; /* print out debugging info */ int vflag; /* verbose flag */ int qflag; /* abort on operator intervention required */ int Mflag; /* multi-volume flag */ char lastmsg[BUFSIZ]; const char *msgprefix; void msg(const char *fmt, ...) { va_list ap; if (msgprefix) (void) fprintf(stderr," %s: ", msgprefix); if (dflag&TDEBUG) { if (dflag&DEBUG_PRINT_LEVEL) fprintf(stderr, "%08x/" "pid=%d ", TDEBUG, getpid()); else fprintf(stderr, "pid=%d ", getpid()); } va_start(ap, fmt); (void) vfprintf(stderr, fmt, ap); va_end(ap); (void) fflush(stdout); (void) fflush(stderr); va_start(ap, fmt); (void) vsnprintf(lastmsg, sizeof(lastmsg), fmt, ap); va_end(ap); } void msgtail(const char *fmt, ...) { va_list ap; va_start(ap, fmt); (void) vfprintf(stderr, fmt, ap); va_end(ap); }