diff options
-rw-r--r-- | utils/start-stop-daemon.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index ce95fd1d1..c35f44812 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -344,10 +344,11 @@ timespec_sub(struct timespec *a, struct timespec *b, struct timespec *res) static void timespec_mul(struct timespec *a, int b) { + long nsec = a->tv_nsec * b; + a->tv_sec *= b; - a->tv_nsec *= b; - a->tv_sec = a->tv_sec + a->tv_nsec / NANOSEC_IN_SEC; - a->tv_nsec %= NANOSEC_IN_SEC; + a->tv_sec += nsec / NANOSEC_IN_SEC; + a->tv_nsec = nsec % NANOSEC_IN_SEC; } static char * |