diff options
author | rsc <devnull@localhost> | 2003-11-24 00:43:41 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2003-11-24 00:43:41 +0000 |
commit | d2c4ee9e488f6c94865cc2f4c874d025bc2ae0d2 (patch) | |
tree | 2a0b4a292687bf21d9966692516dd439181b0ec1 /src/lib9/dirwstat.c | |
parent | 478ee9636fcfe3509d0a901d1250524a5c41d3a8 (diff) | |
download | plan9port-d2c4ee9e488f6c94865cc2f4c874d025bc2ae0d2.tar.gz plan9port-d2c4ee9e488f6c94865cc2f4c874d025bc2ae0d2.tar.bz2 plan9port-d2c4ee9e488f6c94865cc2f4c874d025bc2ae0d2.zip |
Tweaks to build properly on Linux.
Diffstat (limited to 'src/lib9/dirwstat.c')
-rw-r--r-- | src/lib9/dirwstat.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib9/dirwstat.c b/src/lib9/dirwstat.c index 573dd376..d003ac83 100644 --- a/src/lib9/dirwstat.c +++ b/src/lib9/dirwstat.c @@ -3,19 +3,18 @@ #include <libc.h> #include <sys/time.h> +#include <utime.h> int dirwstat(char *file, Dir *dir) { - struct timeval tv[2]; + struct utimbuf ub; /* BUG handle more */ if(dir->mtime == ~0ULL) return 0; - tv[0].tv_sec = dir->mtime; - tv[0].tv_usec = 0; - tv[1].tv_sec = dir->mtime; - tv[1].tv_usec = 0; - return utimes(file, tv); + ub.actime = dir->mtime; + ub.modtime = dir->mtime; + return utime(file, &ub); } |