(*utime) should probably update even 'ctime' (to the current time). Fixed.
authorlace <>
Wed, 28 Dec 2005 07:12:53 +0000 (07:12 +0000)
committerlace <>
Wed, 28 Dec 2005 07:12:53 +0000 (07:12 +0000)
src/client/fuse/op_utime.c

index e106bbd..99f74fb 100644 (file)
@@ -25,6 +25,7 @@
 #include <captive/client-file.h>
 #include <sys/stat.h>
 #include <captive/macros.h>
+#include <time.h>
 
 #include "op_utime.h"  /* self */
 #include "main.h"
@@ -49,14 +50,18 @@ GnomeVFSFileInfo file_info;
 
        file_info.valid_fields=0
                        |GNOME_VFS_FILE_INFO_FIELDS_ATIME
-                       |GNOME_VFS_FILE_INFO_FIELDS_MTIME;
+                       |GNOME_VFS_FILE_INFO_FIELDS_MTIME
+                       |GNOME_VFS_FILE_INFO_FIELDS_CTIME;
        file_info.atime=buf->actime;
        file_info.mtime=buf->modtime;
-       /* It is probably not GnomeVFS compliant but still libcaptive compatible.
-        * GnomeVFS looks as assuming all the three fields set.
-        * GnomeVFS also does not check 'valid_fields' at all.
+       file_info.ctime=time(NULL);
+       /* Do not:  * It is probably not GnomeVFS compliant but still libcaptive compatible.
+        *          * GnomeVFS looks as assuming all the three fields set.
+        *          * GnomeVFS also does not check 'valid_fields' at all.
+        *         file_info.ctime=0;   * Just sanity for sure. *
+        *         file_info.valid_fields&=~GNOME_VFS_FILE_INFO_FIELDS_CTIME;
+        * as utime() syscall should really update 'ctime' to the current time.
         */
-       file_info.ctime=0;      /* Just sanity for sure. */
        errvfsresult=captive_file_file_info_set(captive_file_object,&file_info,GNOME_VFS_SET_FILE_INFO_TIME);
 
        g_object_unref(captive_file_object);