From 230fe2a5a10f2bc128f354e3fb1b48536b1f143b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 19 Sep 2013 14:40:08 -0700 Subject: Merge from gnulib. This incorporates the following changes: 2013-09-19 stdio: OS X port of putc_unlocked + extern inline 2013-09-19 signal: OS X port of sigaddset etc. + extern inline 2013-09-19 extern-inline: do not always suppress extern inline on OS X 2013-09-17 getgroups: statement without effect 2013-08-28 headers: check that _GL_INLINE_HEADER_BEGIN is defined --- lib/timespec-sub.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/timespec-sub.c') diff --git a/lib/timespec-sub.c b/lib/timespec-sub.c index 97c9f9de88c..b164a8380d0 100644 --- a/lib/timespec-sub.c +++ b/lib/timespec-sub.c @@ -29,7 +29,6 @@ struct timespec timespec_sub (struct timespec a, struct timespec b) { - struct timespec r; time_t rs = a.tv_sec; time_t bs = b.tv_sec; int ns = a.tv_nsec - b.tv_nsec; @@ -37,7 +36,7 @@ timespec_sub (struct timespec a, struct timespec b) if (ns < 0) { - rns = ns + 1000000000; + rns = ns + TIMESPEC_RESOLUTION; if (rs == TYPE_MINIMUM (time_t)) { if (bs <= 0) @@ -65,7 +64,5 @@ timespec_sub (struct timespec a, struct timespec b) else rs -= bs; - r.tv_sec = rs; - r.tv_nsec = rns; - return r; + return make_timespec (rs, rns); } -- cgit v1.2.1