| 1 |
#include "config.h" |
| 2 |
|
| 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 |
|
| 13 |
|
| 14 |
int ntrec = NTREC; |
| 15 |
int abortifconnerr = 1; |
| 16 |
|
| 17 |
int rshpid = -1; |
| 18 |
|
| 19 |
int dokerberos; |
| 20 |
union u_spcl u_spcl; |
| 21 |
union u_data u_data; |
| 22 |
char *usedinomap; |
| 23 |
char *dumpinomap; |
| 24 |
dump_ino_t volinfo[TP_NINOS]; |
| 25 |
uint32_t dflag; |
| 26 |
int vflag; |
| 27 |
int qflag; |
| 28 |
int Mflag; |
| 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 |
} |