X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=lib%2Futimens.c;fp=lib%2Futimens.c;h=ece9b07bbb3d4fb5b9889ed1d5a507c6760fe333;hb=20fcfc81ece044b8b0a6768ec6cf47be4e22a2e6;hp=013843d6da445f739ed5c5c26579836fce6138d7;hpb=d57728a6ca2413a7c564d8b7bb13d9e5a5a180f3;p=debian%2Fgzip diff --git a/lib/utimens.c b/lib/utimens.c index 013843d..ece9b07 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-2016 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 @@ -24,7 +24,6 @@ #define _GL_UTIMENS_INLINE _GL_EXTERN_INLINE #include "utimens.h" -#include #include #include #include @@ -87,13 +86,14 @@ validate_timespec (struct timespec timespec[2]) { int result = 0; int utime_omit_count = 0; - 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;