From 50ae6bc9d310c1192c0f6241f23431ff3976a157 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 15 Oct 2004 08:20:12 +0000 Subject: [PATCH] - Handle several mtab changes in the same second (#132976) --- gnome-vfs-2.8.2-mtab-mtime-check.patch | 151 +++++++++++++++++++++++++ gnome-vfs2.spec | 8 +- 2 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 gnome-vfs-2.8.2-mtab-mtime-check.patch diff --git a/gnome-vfs-2.8.2-mtab-mtime-check.patch b/gnome-vfs-2.8.2-mtab-mtime-check.patch new file mode 100644 index 0000000..fb80768 --- /dev/null +++ b/gnome-vfs-2.8.2-mtab-mtime-check.patch @@ -0,0 +1,151 @@ +Index: libgnomevfs/gnome-vfs-unix-mounts.c +=================================================================== +RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-unix-mounts.c,v +retrieving revision 1.17 +diff -u -p -r1.17 gnome-vfs-unix-mounts.c +--- libgnomevfs/gnome-vfs-unix-mounts.c 22 Sep 2004 08:38:38 -0000 1.17 ++++ libgnomevfs/gnome-vfs-unix-mounts.c 15 Oct 2004 08:14:01 -0000 +@@ -235,6 +235,7 @@ gboolean + _gnome_vfs_get_current_unix_mounts (GList **return_list) + { + static time_t last_mtime = 0; ++ static off_t last_size = 0; + struct mntent *mntent; + FILE *file; + char *read_file; +@@ -254,11 +255,12 @@ _gnome_vfs_get_current_unix_mounts (GLis + return TRUE; + } + +- if (sb.st_mtime == last_mtime) { ++ if (sb.st_mtime == last_mtime && sb.st_size == last_size) { + return FALSE; + } + + last_mtime = sb.st_mtime; ++ last_size = sb.st_size; + + file = setmntent (read_file, "r"); + if (file == NULL) { +@@ -332,6 +334,7 @@ gboolean + _gnome_vfs_get_current_unix_mounts (GList **return_list) + { + static time_t last_mtime = 0; ++ static off_t last_size = 0; + struct mnttab mntent; + FILE *file; + char *read_file; +@@ -350,11 +353,12 @@ _gnome_vfs_get_current_unix_mounts (GLis + return TRUE; + } + +- if (sb.st_mtime == last_mtime) { ++ if (sb.st_mtime == last_mtime && sb.st_size == last_size) { + return FALSE; + } + + last_mtime = sb.st_mtime; ++ last_size = sb.st_size; + + file = setmntent (read_file, "r"); + if (file == NULL) { +@@ -526,6 +530,7 @@ gboolean + _gnome_vfs_get_unix_mount_table (GList **return_list) + { + static time_t last_mtime = 0; ++ static off_t last_size = 0; + struct mntent *mntent; + FILE *file; + char *read_file; +@@ -544,11 +549,12 @@ _gnome_vfs_get_unix_mount_table (GList * + return TRUE; + } + +- if (sb.st_mtime == last_mtime) { ++ if (sb.st_mtime == last_mtime && sb.st_size == last_size) { + return FALSE; + } + + last_mtime = sb.st_mtime; ++ last_size = sb.st_size; + + file = setmntent (read_file, "r"); + if (file == NULL) { +@@ -613,6 +619,7 @@ gboolean + _gnome_vfs_get_unix_mount_table (GList **return_list) + { + static time_t last_mtime = 0; ++ static off_t last_size = 0; + struct mnttab mntent; + FILE *file; + char *read_file; +@@ -630,11 +637,12 @@ _gnome_vfs_get_unix_mount_table (GList * + return TRUE; + } + +- if (sb.st_mtime == last_mtime) { ++ if (sb.st_mtime == last_mtime && sb.st_size == last_size) { + return FALSE; + } + + last_mtime = sb.st_mtime; ++ last_size = sb.st_size; + + file = setmntent (read_file, "r"); + if (file == NULL) { +@@ -801,6 +809,7 @@ gboolean + _gnome_vfs_get_unix_mount_table (GList **return_list) + { + static time_t last_mtime = 0; ++ static off_t last_size = 0; + struct mntent *mntent; + FILE *file; + char *read_file; +@@ -813,17 +822,17 @@ _gnome_vfs_get_unix_mount_table (GList * + + *return_list = NULL; + +- if (last_mtime != 0) { +- if (stat (stat_file, &sb) < 0) { +- g_warning ("Unable to stat %s: %s", stat_file, +- g_strerror (errno)); +- return TRUE; +- } ++ if (stat (stat_file, &sb) < 0) { ++ g_warning ("Unable to stat %s: %s", stat_file, ++ g_strerror (errno)); ++ return TRUE; ++ } + +- if (sb.st_mtime == last_mtime) { +- return FALSE; +- } ++ if (last_mtime != 0 && fsb.st_mtime == last_mtime && fsb.st_size == last_size) { ++ return FALSE; + } ++ last_mtime = fsb.st_mtime; ++ last_size = fsb.st_size; + + file = setmntent (read_file, "r"); + if (file == NULL) { +@@ -857,6 +866,7 @@ gboolean + _gnome_vfs_get_unix_mount_table (GList **return_list) + { + static time_t last_mtime = 0; ++ static off_t last_size = 0; + struct fstab *fstab = NULL; + char *stat_file; + struct stat fsb; +@@ -875,10 +885,11 @@ _gnome_vfs_get_unix_mount_table (GList * + return TRUE; + } + +- if (last_mtime != 0 && fsb.st_mtime == last_mtime) { ++ if (last_mtime != 0 && fsb.st_mtime == last_mtime && fsb.st_size == last_size) { + return FALSE; + } + last_mtime = fsb.st_mtime; ++ last_size = fsb.st_size; + + *return_list = NULL; + diff --git a/gnome-vfs2.spec b/gnome-vfs2.spec index 0930f73..febf675 100644 --- a/gnome-vfs2.spec +++ b/gnome-vfs2.spec @@ -10,7 +10,7 @@ Summary: The GNOME virtual file-system libraries. Name: gnome-vfs2 Version: 2.8.2 -Release: 3 +Release: 4 License: LGPL Group: System Environment/Libraries Source: gnome-vfs-%{version}.tar.bz2 @@ -62,7 +62,7 @@ Patch51: desktop-file-utils-0.8-pleasecreate.patch # send to upstream Patch101: gnome-vfs-2.7.90-schema_about_for_upstream.patch Patch102: gnome-vfs-2.8.2-bufer-fix.patch - +Patch103: gnome-vfs-2.8.2-mtab-mtime-check.patch Patch200: gnome-vfs-2.8.1-hal.patch Patch201: gnome-vfs-2.8.1-console-mount-opt.patch @@ -139,6 +139,7 @@ perl -pi -e 's/favorites:\s+libvfolder-desktop.so//g' $DMC # send to upstream %patch101 -p1 -b .schema_about %patch102 -p0 -b .buffer-fix +%patch103 -p0 -b .mtab_mtime_check %patch200 -p0 -b .hal %patch201 -p0 -b .console @@ -255,6 +256,9 @@ done %config %{_sysconfdir}/gnome-vfs-2.0/modules/smb-module.conf %changelog +* Fri Oct 15 2004 Alexander Larsson - 2.8.2-4 +- Handle several mtab changes in the same second (#132976) + * Thu Oct 14 2004 David Zeuthen 2.8.2-3 - Change console to pamconsole to support new util-linux and hal packages