]> arthur.barton.de Git - bup.git/commit
Normalize stat(2) timespecs in _helpers.c.
authorRob Browning <rlb@defaultvalue.org>
Sun, 17 Feb 2013 16:33:08 +0000 (10:33 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 10 Mar 2013 17:22:32 +0000 (12:22 -0500)
commit207513d0186fa5bd6fef8aea3edc6bbe929763fe
tree6d644eb55cbc740a86f51683cbb7da3e315e4bb5
parentb5ae9433b8d43275f68d97a89a81d0816e777e15
Normalize stat(2) timespecs in _helpers.c.

Previously, the code required timespecs to have a nanosecond value
between 0 and 999999999, because that's what Linux appeared to
produce, but other platforms don't (i.e. Cygwin) -- so normalize the
system values to match expectations.

In particular, look for negative nanosecond values (must be greater
than -10**9), and if found, rewrite the timespec with non-negative
nanoseconds (still less than 10**9).

Thanks to Will Rouesnel <w.rouesnel@gmail.com> for reporting the
problem and posting an initial patch.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/_helpers.c