Really fix --signal 0
This commit is contained in:
parent
2ea1df634e
commit
6e485bde39
@ -649,7 +649,7 @@ start_stop_daemon(int argc, char **argv)
|
|||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
char *pidfile = NULL;
|
char *pidfile = NULL;
|
||||||
char *retry = NULL;
|
char *retry = NULL;
|
||||||
int sig = 0;
|
int sig = -1;
|
||||||
int nicelevel = 0;
|
int nicelevel = 0;
|
||||||
bool background = false;
|
bool background = false;
|
||||||
bool makepidfile = false;
|
bool makepidfile = false;
|
||||||
@ -886,8 +886,8 @@ start_stop_daemon(int argc, char **argv)
|
|||||||
else if (exec)
|
else if (exec)
|
||||||
*--argv = exec;
|
*--argv = exec;
|
||||||
|
|
||||||
if (stop || sig != 0) {
|
if (stop || sig != -1) {
|
||||||
if (sig == 0)
|
if (sig == -1)
|
||||||
sig = SIGTERM;
|
sig = SIGTERM;
|
||||||
if (!*argv && !pidfile && !name && !uid)
|
if (!*argv && !pidfile && !name && !uid)
|
||||||
eerrorx("%s: --stop needs --exec, --pidfile,"
|
eerrorx("%s: --stop needs --exec, --pidfile,"
|
||||||
@ -990,8 +990,8 @@ start_stop_daemon(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
margv = nav ? nav : argv;
|
margv = nav ? nav : argv;
|
||||||
|
|
||||||
if (stop || sig) {
|
if (stop || sig != -1) {
|
||||||
if (sig == 0)
|
if (sig == -1)
|
||||||
sig = SIGTERM;
|
sig = SIGTERM;
|
||||||
if (!stop)
|
if (!stop)
|
||||||
oknodo = true;
|
oknodo = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user