mirror of
https://https.git.savannah.gnu.org/git/coreutils.git
synced 2026-01-26 15:29:07 +00:00
(settime): If settimeofday fails, give up right away.
This commit is contained in:
parent
346afb38ab
commit
37016136c9
@ -53,13 +53,10 @@ settime (struct timespec const *ts)
|
||||
#if HAVE_SETTIMEOFDAY
|
||||
{
|
||||
struct timeval tv;
|
||||
int r;
|
||||
|
||||
tv.tv_sec = ts->tv_sec;
|
||||
tv.tv_usec = ts->tv_nsec / 1000;
|
||||
r = settimeofday (&tv, 0);
|
||||
if (r == 0 || errno == EPERM)
|
||||
return r;
|
||||
return settimeofday (&tv, 0);
|
||||
}
|
||||
#elif HAVE_STIME
|
||||
/* This fails to compile on OSF1 V5.1, due to stime requiring
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user