aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/dirfwstat.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2003-11-25 02:11:11 +0000
committerrsc <devnull@localhost>2003-11-25 02:11:11 +0000
commit64bcfff3a12695f4e3f54b0590e896611da71c3b (patch)
tree4069bf27ba50ec5fa81e1ca201fc38cf3cb496be /src/lib9/dirfwstat.c
parentf7012583e9a7594cbb5ebe8e974bb69061189262 (diff)
downloadplan9port-64bcfff3a12695f4e3f54b0590e896611da71c3b.tar.gz
plan9port-64bcfff3a12695f4e3f54b0590e896611da71c3b.tar.bz2
plan9port-64bcfff3a12695f4e3f54b0590e896611da71c3b.zip
More tweaks on Linux and Solaris.
Diffstat (limited to 'src/lib9/dirfwstat.c')
-rw-r--r--src/lib9/dirfwstat.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/lib9/dirfwstat.c b/src/lib9/dirfwstat.c
index c7cf64d6..7144e7cd 100644
--- a/src/lib9/dirfwstat.c
+++ b/src/lib9/dirfwstat.c
@@ -1,22 +1,30 @@
#include <u.h>
-#define NOPLAN9DEFINES
#include <libc.h>
-
#include <sys/time.h>
-#if !defined(_HAVEFUTIMES) && defined(_HAVEFUTIMESAT)
+#if defined(__FreeBSD__) || defined(__APPLE__)
+/* do nothing -- futimes exists and is fine */
+
+#elif defined(__sun__)
+/* use futimesat */
static int
futimes(int fd, struct timeval *tv)
{
return futimesat(fd, 0, tv);
}
-#elif !defined(_HAVEFUTIMES)
+
+#else
+/* provide dummy */
+/* rename just in case -- linux provides an unusable one */
+#undef futimes
+#define futimes myfutimes
static int
futimes(int fd, struct timeval *tv)
{
werrstr("futimes not available");
return -1;
}
+
#endif
int
@@ -25,6 +33,7 @@ dirfwstat(int fd, Dir *dir)
int ret;
struct timeval tv[2];
+ ret = 0;
if(~dir->mode != 0){
if(fchmod(fd, dir->mode) < 0)
ret = -1;