From 7d61416a443b1786158c6236f182b6c11b3619f7 Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Tue, 15 Feb 2011 03:08:17 +0000 Subject: features/marker: open the timestamp file with O_TRUNC to update the ctime Signed-off-by: Kaushik BV Signed-off-by: Vijay Bellur BUG: 2354 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2354 --- xlators/features/marker/src/marker.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'xlators/features/marker') diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 47ce20f861a..f6302247e5e 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -1002,14 +1002,11 @@ call_from_sp_client_to_reset_tmfile (call_frame_t *frame, if (data->len == 0 || (data->len == 5 && memcmp (data->data, "RESET", 5) == 0)) { - fd = open (priv->timestamp_file, O_WRONLY); + fd = open (priv->timestamp_file, O_WRONLY|O_TRUNC); if (fd != -1) { - /* this call is needed because of the unsurity - * whether the O_TRUNC would update the timestamps - * on a zero length file as well. Hence updating it - * manually. + /* TODO check whether the O_TRUNC would update the + * timestamps on a zero length file on all machies. */ - futimens (fd, NULL); close (fd); } -- cgit