diff options
author | Ron Yorston <rmy@pobox.com> | 2018-05-13 08:15:58 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-05-13 08:15:58 +0100 |
commit | 3ce461fdf3b7adfd44ea058fa0c5ca6d91a5bc5d (patch) | |
tree | a527d0db15f34a137fc11df5538c7f2f7c6d72de /debianutils | |
parent | 6f7d1af269eed4b42daeb9c6dfd2ba62f9cd47e4 (diff) | |
parent | d80eecb86812c1fbda652f9b995060c26ba0b155 (diff) | |
download | busybox-w32-3ce461fdf3b7adfd44ea058fa0c5ca6d91a5bc5d.tar.gz busybox-w32-3ce461fdf3b7adfd44ea058fa0c5ca6d91a5bc5d.tar.bz2 busybox-w32-3ce461fdf3b7adfd44ea058fa0c5ca6d91a5bc5d.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'debianutils')
-rw-r--r-- | debianutils/start_stop_daemon.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c index fa77a7e00..43b6fca26 100644 --- a/debianutils/start_stop_daemon.c +++ b/debianutils/start_stop_daemon.c | |||
@@ -157,6 +157,9 @@ struct globals { | |||
157 | unsigned execname_sizeof; | 157 | unsigned execname_sizeof; |
158 | int user_id; | 158 | int user_id; |
159 | smallint signal_nr; | 159 | smallint signal_nr; |
160 | #ifdef OLDER_VERSION_OF_X | ||
161 | struct stat execstat; | ||
162 | #endif | ||
160 | } FIX_ALIASING; | 163 | } FIX_ALIASING; |
161 | #define G (*(struct globals*)bb_common_bufsiz1) | 164 | #define G (*(struct globals*)bb_common_bufsiz1) |
162 | #define userspec (G.userspec ) | 165 | #define userspec (G.userspec ) |
@@ -184,13 +187,12 @@ static int pid_is_exec(pid_t pid) | |||
184 | sprintf(buf, "/proc/%u/exe", (unsigned)pid); | 187 | sprintf(buf, "/proc/%u/exe", (unsigned)pid); |
185 | if (stat(buf, &st) < 0) | 188 | if (stat(buf, &st) < 0) |
186 | return 0; | 189 | return 0; |
187 | if (st.st_dev == execstat.st_dev | 190 | if (st.st_dev == G.execstat.st_dev |
188 | && st.st_ino == execstat.st_ino) | 191 | && st.st_ino == G.execstat.st_ino) |
189 | return 1; | 192 | return 1; |
190 | return 0; | 193 | return 0; |
191 | } | 194 | } |
192 | #endif | 195 | #else |
193 | |||
194 | static int pid_is_exec(pid_t pid) | 196 | static int pid_is_exec(pid_t pid) |
195 | { | 197 | { |
196 | ssize_t bytes; | 198 | ssize_t bytes; |
@@ -214,6 +216,7 @@ static int pid_is_exec(pid_t pid) | |||
214 | } | 216 | } |
215 | return 0; | 217 | return 0; |
216 | } | 218 | } |
219 | #endif | ||
217 | 220 | ||
218 | static int pid_is_name(pid_t pid) | 221 | static int pid_is_name(pid_t pid) |
219 | { | 222 | { |
@@ -408,9 +411,6 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv) | |||
408 | char *signame; | 411 | char *signame; |
409 | char *startas; | 412 | char *startas; |
410 | char *chuid; | 413 | char *chuid; |
411 | #ifdef OLDER_VERSION_OF_X | ||
412 | struct stat execstat; | ||
413 | #endif | ||
414 | #if ENABLE_FEATURE_START_STOP_DAEMON_FANCY | 414 | #if ENABLE_FEATURE_START_STOP_DAEMON_FANCY |
415 | // char *retry_arg = NULL; | 415 | // char *retry_arg = NULL; |
416 | // int retries = -1; | 416 | // int retries = -1; |
@@ -479,7 +479,7 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv) | |||
479 | 479 | ||
480 | #ifdef OLDER_VERSION_OF_X | 480 | #ifdef OLDER_VERSION_OF_X |
481 | if (execname) | 481 | if (execname) |
482 | xstat(execname, &execstat); | 482 | xstat(execname, &G.execstat); |
483 | #endif | 483 | #endif |
484 | 484 | ||
485 | *--argv = startas; | 485 | *--argv = startas; |