diff options
author | Guillem Jover <guillem@debian.org> | 2015-04-23 21:06:32 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2015-05-09 04:55:45 +0200 |
commit | 349f9c3569cb978f1cc0e69ac00d573d99581a18 (patch) | |
tree | 28d17d8a2e1f5d59586a57dad25543d6d3e4d36c /utils/start-stop-daemon.c | |
parent | 033b2950694fc3fa6d90dca34de1e4f8fa06c934 (diff) | |
download | dpkg-349f9c3569cb978f1cc0e69ac00d573d99581a18.tar.gz |
s-s-d: Cleanup timespec_mul()
Diffstat (limited to 'utils/start-stop-daemon.c')
-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 * |