... | ... |
@@ -65,6 +65,7 @@ extern int active_children; |
65 | 65 |
static short foreground = 1; |
66 | 66 |
char updtmpdir[512], dbdir[512]; |
67 | 67 |
int sigchld_wait = 1; |
68 |
+const char *pidfile = NULL; |
|
68 | 69 |
|
69 | 70 |
static void sighandler(int sig) { |
70 | 71 |
|
... | ... |
@@ -103,7 +104,9 @@ static void sighandler(int sig) { |
103 | 103 |
default: |
104 | 104 |
if(*updtmpdir) |
105 | 105 |
cli_rmdirs(updtmpdir); |
106 |
- logg("Update process interrupted\n"); |
|
106 |
+ if(pidfile) |
|
107 |
+ unlink(pidfile); |
|
108 |
+ logg("Update process terminated\n"); |
|
107 | 109 |
exit(2); |
108 | 110 |
} |
109 | 111 |
|
... | ... |
@@ -224,7 +227,7 @@ static void msg_callback(enum cl_msg severity, const char *fullmsg, const char * |
224 | 224 |
int main(int argc, char **argv) |
225 | 225 |
{ |
226 | 226 |
int ret = 52, retcl; |
227 |
- const char *cfgfile, *arg = NULL, *pidfile = NULL; |
|
227 |
+ const char *cfgfile, *arg = NULL; |
|
228 | 228 |
char *pt; |
229 | 229 |
struct optstruct *opts; |
230 | 230 |
const struct optstruct *opt; |