Description: Upstream's fix for a carry bug
Author: Andrew Pollock <apollock@google.com>
Origin: upstream, https://code.google.com/p/cronutils/source/detail?r=30a2aa9e7755ca0bb43889d4b796b00be5da27f5
Forwarded: not-needed
Last-Update: 2013-08-29

Index: cronutils-1.1/runstat.c
===================================================================
--- cronutils-1.1.orig/runstat.c	2013-08-29 10:52:02.000000000 +1000
+++ cronutils-1.1/runstat.c	2013-08-29 10:53:20.000000000 +1000
@@ -196,6 +196,10 @@
   /** timing */
   elapsed_sec = end_run_time.tv_sec - start_run_time.tv_sec;
   elapsed_nsec = end_run_time.tv_nsec - start_run_time.tv_nsec;
+  if (elapsed_nsec < 0) {
+    elapsed_nsec += 1e9;
+    elapsed_sec--;
+  }
   /* GAUGE hostname/runstat-progname/last_run-elapsed-time */
   add_variable(&var_list, "elapsed_time", GAUGE, "s",
                "%ld.%.9ld", elapsed_sec, elapsed_nsec);
