Debian Codegraph @

common/shared_globals.c

raw symbols SCIP
1 #include "config.h" // IWYU pragma: keep
2 // IWYU pragma: no_include "dump_globals.h"
3 #include "shared_globals.h"
4
5 #include <stdint.h>
6 #include <unistd.h>
7 #include <stdarg.h>
8 #include <stdio.h>
9
10 #include "compat/include/protocols/dumprestore.h"
11
12 /* Global variables used by both dump and restore */
13
14 int ntrec = NTREC; /* number of TP_BSIZE records per tape block */
15 int abortifconnerr = 1; /* set to 1 if dumprmt should exit on connection errors
16 otherwise just print a message using msg */
17 int rshpid = -1;
18
19 int dokerberos;
20 union u_spcl u_spcl;
21 union u_data u_data;
22 char *usedinomap; /* map of inodes that are in use on this fs */
23 char *dumpinomap; /* map of inodes on this dump tape */
24 dump_ino_t volinfo[TP_NINOS]; /* which inode on which volume archive info */
25 uint32_t dflag; /* print out debugging info */
26 int vflag; /* verbose flag */
27 int qflag; /* abort on operator intervention required */
28 int Mflag; /* multi-volume flag */
29 char lastmsg[BUFSIZ];
30 const char *msgprefix;
31
32 void msg(const char *fmt, ...)
33 {
34 va_list ap;
35
36 if (msgprefix)
37 (void) fprintf(stderr," %s: ", msgprefix);
38
39 if (dflag&TDEBUG) {
40 if (dflag&DEBUG_PRINT_LEVEL)
41 fprintf(stderr, "%08x/" "pid=%d ", TDEBUG, getpid());
42 else
43 fprintf(stderr, "pid=%d ", getpid());
44 }
45
46 va_start(ap, fmt);
47 (void) vfprintf(stderr, fmt, ap);
48 va_end(ap);
49 (void) fflush(stdout);
50 (void) fflush(stderr);
51 va_start(ap, fmt);
52 (void) vsnprintf(lastmsg, sizeof(lastmsg), fmt, ap);
53 va_end(ap);
54 }
55
56 void msgtail(const char *fmt, ...)
57 {
58 va_list ap;
59 va_start(ap, fmt);
60 (void) vfprintf(stderr, fmt, ap);
61 va_end(ap);
62 }