]> code.delx.au - gnu-emacs/blobdiff - lib/timespec-add.c
Fix for crash when displaying xwidget in a tty
[gnu-emacs] / lib / timespec-add.c
index 51323a63207d50eb25dcc16b7d658629da8cecc1..255489eeb13713a815fc9fa7344c7c2f1c34eb67 100644 (file)
@@ -1,6 +1,6 @@
 /* Add two struct timespec values.
 
-   Copyright (C) 2011-2013 Free Software Foundation, Inc.
+   Copyright (C) 2011-2015 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
@@ -18,7 +18,7 @@
 /* Written by Paul Eggert.  */
 
 /* Return the sum of two timespec values A and B.  On overflow, return
-   an extremal value.  This assumes 0 <= tv_nsec <= 999999999.  */
+   an extremal value.  This assumes 0 <= tv_nsec < TIMESPEC_RESOLUTION.  */
 
 #include <config.h>
 #include "timespec.h"
@@ -58,7 +58,7 @@ timespec_add (struct timespec a, struct timespec b)
         {
         high_overflow:
           rs = TYPE_MAXIMUM (time_t);
-          rns = 999999999;
+          rns = TIMESPEC_RESOLUTION - 1;
         }
     }
   else