ucp: Set file times correctly
authorWill Sowerbutts <will@sowerbutts.com>
Sat, 14 Feb 2015 22:36:23 +0000 (22:36 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Sat, 14 Feb 2015 22:36:23 +0000 (22:36 +0000)
Standalone/xfs1b.c
Standalone/xfs2.c

index 84ca02f..09d7940 100644 (file)
@@ -444,10 +444,3 @@ int _umount(char *spec)
        i_deref(sino);
        return (-1);
 }
-
-int _time(int tvec[])
-{
-       udata.u_error = 0;
-       // rdtime(tvec);  /* In machdep.c */
-       return (0);
-}
index f44ae7b..aba3541 100644 (file)
@@ -7,6 +7,7 @@ UZI (Unix Z80 Implementation) Utilities:  xfs2.c
  */
 
  /*LINTLIBRARY*/
+#include <time.h>
 #include <stdio.h>
 #include <strings.h>
 #include <stdint.h>
@@ -961,14 +962,17 @@ int getperm(inoptr ino)
  */
 void setftime(inoptr ino, int flag)
 {
+       time_t now;
        ino->c_dirty = 1;
 
-       //if (flag & A_TIME)
-       //    rdtime(&(ino->c_node.i_atime));
-       //if (flag & M_TIME)
-       //    rdtime(&(ino->c_node.i_mtime));
-       //if (flag & C_TIME)
-       //    rdtime(&(ino->c_node.i_ctime));
+       now = time(NULL);
+
+       if (flag & A_TIME)
+               ino->c_node.i_atime = now;
+       if (flag & M_TIME)
+               ino->c_node.i_mtime = now;
+       if (flag & C_TIME)
+               ino->c_node.i_ctime = now;
 }