summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-09-29 13:13:49 +0000
committerJim Meyering <jim@meyering.net>2005-09-29 13:13:49 +0000
commit33b113c638726bb3d68e5a5aa717fd05380c7a22 (patch)
tree7853458eba65b57bf2501a04b232dce34c763d13 /lib
parent21e670cb0d2fcaebb34c09494c6750c87885b2e7 (diff)
downloadcoreutils-33b113c638726bb3d68e5a5aa717fd05380c7a22.tar.xz
(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'.
Diffstat (limited to 'lib')
-rw-r--r--lib/settime.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/settime.c b/lib/settime.c
index 76bf70632..6fbee50f5 100644
--- a/lib/settime.c
+++ b/lib/settime.c
@@ -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
}