diff options
author | Lennart Poettering <lennart@poettering.net> | 2003-10-17 00:09:23 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2003-10-17 00:09:23 +0000 |
commit | 6abfd933e73966931fb37471f15f91ffc42c23b6 (patch) | |
tree | b9e6ffc80b22f403debe3b52f7d3cf4182caa2ad /src/ifplugd.c | |
parent | 3466defa6628261499d050c92769beacb9dd792e (diff) |
many fixes
git-svn-id: file:///home/lennart/svn/public/ifplugd/trunk@52 2bf48fe7-cfc1-0310-909f-d9042e1e0fef
Diffstat (limited to 'src/ifplugd.c')
-rw-r--r-- | src/ifplugd.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/ifplugd.c b/src/ifplugd.c index 18c883b..322870f 100644 --- a/src/ifplugd.c +++ b/src/ifplugd.c @@ -221,8 +221,6 @@ int action(interface_status_t status) { daemon_log(LOG_WARNING, "Killing child."); kill(pid, SIGTERM); } - - break; } } @@ -579,7 +577,7 @@ void work(void) { } cleanup: - if (!no_shutdown_script && status == IFSTATUS_UP) { + if (!no_shutdown_script && (status == IFSTATUS_UP || (status == IFSTATUS_DOWN && t))) { setenv(IFPLUGD_ENV_PREVIOUS, strstatus(status), 1); setenv(IFPLUGD_ENV_CURRENT, strstatus(-1), 1); action(IFSTATUS_DOWN); @@ -833,12 +831,13 @@ void parse_args(int argc, char *argv[]) { if (_check) { pid_t pid = daemon_pid_file_is_running(); - if (pid == (pid_t) -1) + if (pid == (pid_t) -1 || pid == 0) { printf("ifplugd not running.\n"); - else + exit(255); + } else { printf("ifplugd process for device %s running as pid %u.\n", interface, pid); - - exit(pid == 0 ? 255 : 0); + exit(0); + } } } |