Merge branch 'stable'
[gnulib.git] / lib / timespec.h
index 3f51db8..db3453a 100644 (file)
@@ -1,6 +1,6 @@
 /* timespec -- System time interface
 
-   Copyright (C) 2000, 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -27,7 +27,9 @@ timespec_cmp (struct timespec a, struct timespec b)
 {
   return (a.tv_sec < b.tv_sec ? -1
          : a.tv_sec > b.tv_sec ? 1
-         : a.tv_nsec - b.tv_nsec);
+         : a.tv_nsec < b.tv_nsec ? -1
+         : a.tv_nsec > b.tv_nsec ? 1
+         : 0);
 }
 
 void gettime (struct timespec *);