]>
Commit | Line | Data |
---|---|---|
846841f4 | 1 | /* |
2 | * $Source$ | |
3 | * $Header$ | |
4 | */ | |
5 | ||
6 | #define UPCALL_CONT 0 | |
7 | #define UPCALL_STOP 1 | |
8 | ||
2ce085d2 | 9 | #define HARD_FAIL(x) (((x) != 0 ) && ((x) != MR_NO_CHANGE)) |
f66213ea | 10 | #define SOFT_FAIL(x) (((x) == MR_NO_MEM) || ((x) == MR_CANT_CONNECT) || ((x) == MR_CCONFIG) || ((x) == MR_DEADLOCK) || ((x) == MR_BUSY)) |
846841f4 | 11 | |
c8164170 | 12 | |
13 | #define DEADLOCK_WAIT (3 * 60) /* number of seconds to wait after | |
14 | a deadlock before trying again. */ | |
15 | #define DEADLOCK_TRIES 40 /* how many times to try (2 hours) */ | |
16 | ||
846841f4 | 17 | #define UMASK 0007 |
18 | ||
19 | extern char *malloc(), *calloc(), *realloc(); | |
20 | extern int errno; | |
21 | extern char *whoami; | |
22 | ||
23 | #define DBG_PLAIN 01 | |
24 | #define DBG_VERBOSE 02 | |
25 | #define DBG_TRACE 04 | |
26 | ||
27 | #define strrel(s,op,t) (strcmp((s), (t)) op 0) | |
28 | #define strnrel(s,op,t,n) (strncmp((s), (t), (n)) op 0) | |
29 | ||
30 | #define streq(a,b) (strcmp(a,b) == 0) | |
31 | ||
32 | #ifndef BUFSIZ | |
33 | #define BUFSIZ 1024 | |
34 | #endif | |
35 | #ifndef NULL | |
36 | #define NULL (char *) 0 | |
37 | #endif | |
38 | ||
39 | /* globals */ | |
40 | extern int dbg; /* utils.c: set by main() */ | |
41 | ||
42 | #define CHECK_UPCALL_ARGS(num, upcall_name)\ | |
43 | if (argc != num) {\ | |
44 | fprintf(stderr, "%s upcall with %d arguments instead of %d\n",\ | |
45 | upcall_name, argc, num);\ | |
46 | return UPCALL_STOP;\ | |
47 | } | |
48 | ||
49 | ||
50 | struct service { | |
51 | char *service; | |
52 | int interval; | |
53 | char *target; | |
54 | char *script; | |
55 | int dfgen; | |
56 | int dfcheck; | |
57 | char *type; | |
58 | int enable; | |
59 | int inprogress; | |
60 | int harderror; | |
61 | char *errmsg; | |
62 | }; | |
63 | ||
64 | struct svrhost { | |
65 | char *service; | |
66 | char *machine; | |
67 | int enable; | |
68 | int override; | |
69 | int success; | |
70 | int inprogress; | |
71 | int hosterror; | |
72 | char *errmsg; | |
73 | int lasttry; | |
74 | int lastsuccess; | |
75 | int value1; | |
76 | int value2; | |
77 | char *value3; | |
78 | }; | |
79 | ||
80 | ||
81 | /*--> utils.c <--*/ | |
2ce085d2 | 82 | extern void init_mr(); |
846841f4 | 83 | extern void dcm_com_err_hook(); |
84 | extern void leave(); | |
85 | extern void scream(); | |
86 | extern char *strsave(); | |
87 | extern long file_last_mod_time(); | |
88 | extern long current_time(); | |
89 | #define file_exists(file) (access((file), F_OK) == 0) | |
90 | ||
91 | /*--> update.c <--*/ | |
92 | extern void perform_update(); | |
93 | extern int maybe_lock_update(); | |
94 | extern void unlock(); |