mirror of
https://github.com/coreutils/coreutils.git
synced 2025-01-21 15:43:30 +08:00
(settime): Move the HAVE_STIME block `up' into an #elif
block, so that we don't even try to compile it if settimeofday is available. This works around a compilation failure on OSF1 V5.1, due to stime requiring a `long int*' while tv_sec is `int'.
This commit is contained in:
parent
21e670cb0d
commit
33b113c638
@ -61,12 +61,16 @@ settime (struct timespec const *ts)
|
||||
if (r == 0 || errno == EPERM)
|
||||
return r;
|
||||
}
|
||||
#elif HAVE_STIME
|
||||
{
|
||||
/* This fails to compile on OSF1 V5.1, due to stime requiring
|
||||
a `long int*' and tv_sec is `int'. But that system does provide
|
||||
settimeofday. */
|
||||
int r = stime (&ts->tv_sec);
|
||||
if (r == 0 || errno == EPERM)
|
||||
return r;
|
||||
#endif
|
||||
|
||||
#if HAVE_STIME
|
||||
return stime (&ts->tv_sec);
|
||||
#else
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user