aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2009-10-11 13:22:46 -0500
committerRoy Marples <roy@marples.name>2009-10-15 20:25:01 +0100
commitc96a0157424f8f7829a1c1b2f4f365f436159636 (patch)
tree19320a94bd15b833afa5d7ab2ac2352617e49750 /src/rc
parentfdca530d4fe159e086ca0ac1d6e4f188ddcc3fad (diff)
fix wait time for gentoo bug 288495
The wait time was in seconds. This patch converts it to milliseconds.
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/start-stop-daemon.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index d0ee93a8..9f7af9b8 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -37,6 +37,7 @@
#define POLL_INTERVAL 20000000
#define WAIT_PIDFILE 500000000
#define ONE_SECOND 1000000000
+#define ONE_MS 1000000
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -638,7 +639,7 @@ static const char * const longopts_help[] = {
"Test actions, don't do them",
"Change the process user",
"Chroot to this directory",
- "Seconds to wait for daemon start",
+ "Milliseconds to wait for daemon start",
"Binary to start/stop",
"Redirect stdout to file",
"Redirect stderr to file",
@@ -1311,8 +1312,8 @@ start_stop_daemon(int argc, char **argv)
struct timespec ts;
bool alive = false;
- ts.tv_sec = start_wait;
- ts.tv_nsec = 0;
+ ts.tv_sec = start_wait / 1000;
+ ts.tv_nsec = (start_wait % 1000) * ONE_MS;
if (nanosleep(&ts, NULL) == -1) {
if (errno == EINTR)
eerror("%s: caught an interrupt", applet);