X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=blobdiff_plain;f=lib%2Futimens.c;fp=lib%2Futimens.c;h=dd3ec668f3753a7bc9cb70a8c0e15324d0c397c2;hp=013843d6da445f739ed5c5c26579836fce6138d7;hb=458c944ddbb41cd6ba34416db2867eb6f17bf61a;hpb=6a8461af29d6ce87d891ca8e1433848f5f4c45b8 diff --git a/lib/utimens.c b/lib/utimens.c index 013843d6d..dd3ec668f 100644 --- a/lib/utimens.c +++ b/lib/utimens.c @@ -1,6 +1,6 @@ /* Set file access and modification times. - Copyright (C) 2003-2013 Free Software Foundation, Inc. + Copyright (C) 2003-2014 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 the @@ -90,10 +90,12 @@ validate_timespec (struct timespec timespec[2]) assert (timespec); if ((timespec[0].tv_nsec != UTIME_NOW && timespec[0].tv_nsec != UTIME_OMIT - && (timespec[0].tv_nsec < 0 || 1000000000 <= timespec[0].tv_nsec)) + && ! (0 <= timespec[0].tv_nsec + && timespec[0].tv_nsec < TIMESPEC_RESOLUTION)) || (timespec[1].tv_nsec != UTIME_NOW && timespec[1].tv_nsec != UTIME_OMIT - && (timespec[1].tv_nsec < 0 || 1000000000 <= timespec[1].tv_nsec))) + && ! (0 <= timespec[1].tv_nsec + && timespec[1].tv_nsec < TIMESPEC_RESOLUTION))) { errno = EINVAL; return -1;