r14947: add support for file truncate events
authorAndrew Tridgell <tridge@samba.org>
Thu, 6 Apr 2006 11:07:21 +0000 (11:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:00:21 +0000 (14:00 -0500)
(This used to be commit ed1b90407d8ef6e0216931cb3a89cc9a7789ead2)

source4/ntvfs/posix/pvfs_setfileinfo.c

index b00624c0e9540d57de834020db0052be3d1c9aa6..7661d1eb454587722fdb91074cfbef950e885624 100644 (file)
@@ -400,7 +400,7 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
                        if (ret == -1) {
                                return pvfs_map_errno(pvfs, errno);
                        }
-                       change_mask |= FILE_NOTIFY_CHANGE_SIZE;
+                       change_mask |= FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_ATTRIBUTES;
                }
        }
 
@@ -580,6 +580,7 @@ NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
                } else if (truncate(name->full_name, newstats.st.st_size) == -1) {
                        return pvfs_map_errno(pvfs, errno);
                }
+               change_mask |= FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_ATTRIBUTES;
        }
 
        /* possibly change the file timestamps */
@@ -613,10 +614,12 @@ NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
 
        *name = newstats;
 
-       notify_trigger(pvfs->notify_context, 
-                      NOTIFY_ACTION_MODIFIED, 
-                      change_mask,
-                      name->full_name);
+       if (change_mask != 0) {
+               notify_trigger(pvfs->notify_context, 
+                              NOTIFY_ACTION_MODIFIED, 
+                              change_mask,
+                              name->full_name);
+       }
 
        return pvfs_dosattrib_save(pvfs, name, -1);
 }