From fd04aacee17b348da206c13a550dc1029669805f Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 23 Nov 2003 18:12:54 +0000 Subject: Various additions and fixes. --- src/lib9/dirwstat.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/lib9/dirwstat.c (limited to 'src/lib9/dirwstat.c') diff --git a/src/lib9/dirwstat.c b/src/lib9/dirwstat.c new file mode 100644 index 00000000..573dd376 --- /dev/null +++ b/src/lib9/dirwstat.c @@ -0,0 +1,21 @@ +#include +#define NOPLAN9DEFINES +#include + +#include + +int +dirwstat(char *file, Dir *dir) +{ + struct timeval tv[2]; + + /* 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); +} -- cgit v1.2.3