xffm updates

Jasper Huijsmans jasper at moongroup.com
Sun Apr 6 23:15:03 CEST 2003


On Sat, 5 Apr 2003 23:35:22 +0200
Benedikt Meurer <Benedikt.Meurer at unix-ag.uni-siegen.de> wrote:

> On Sat, 05, Apr 2003, Benedikt Meurer wrote:
> 
> > Edscott,
> > 
> > I've updated some things in xffm:
> > 
> > 	- use gthread instead of pthread
> > 	- reworked the fstab stuff (xffm now recognizes if a filesystem
> > 	is
> > 	  already mounted). This needs testing on plattforms without
> > 	  getmntinfo/getfsstat.
> > 	- auto stuff updated
> > 	- use xfce_get_{user,home}dir() instead of g_get_home_dir()
> > 	- use localtime_r() instead of localtime() if available
> > 	- and some other fixes
> 
> Committed with heavily changed fstab.c (linux code is still
> problematic).
> 
> I'd like everybody to upgrade and test the changes.
> 

I think I fixed the linux issue. It seems getmntent() can not be called
nested, so I moved the check for mounted filesystems outside the loop
for existing mount points and it seems to work for me.

I left in the printf() of mounted systems until more people tested it.
Patch follows for those interested. CVS has been updated already.

	Jasper


Index: fstab.c
===================================================================
RCS file: /cvsroot/xfce/xfce-devel/xffm/libs/fstab.c,v
retrieving revision 1.9
diff -u -r1.9 fstab.c
--- fstab.c	5 Apr 2003 21:18:12 -0000	1.9
+++ fstab.c	6 Apr 2003 21:03:49 -0000
@@ -534,6 +534,12 @@
 
 		i++;
 
+	}
+
+        (void)endmntent(fstab_fd);
+	
+	for (i = 0; i < fstat_gdir.pathc; i++)
+	{
 		/*
 		 * Check if filesystem is already mounted
 		 */
@@ -544,18 +550,17 @@
 
 		for (mnt_mounted = getmntent(mtab_fd); mnt_mounted != NULL;
 				mnt_mounted = getmntent(mtab_fd)) {
-			if (!strcmp(mnt_struct->mnt_dir,mnt_mounted->mnt_dir)) {
+			if (!strcmp(fstat_gdir.gl[i].pathv,
+				    mnt_mounted->mnt_dir)) {
 				printf("%s: already mounted\n",
 						mnt_mounted->mnt_dir);
-		    		TOGGLE_MOUNTED(fstat_gdir.gl[i-1].en->type);
+		    		TOGGLE_MOUNTED(fstat_gdir.gl[i].en->type);
 			}
 		}
 
 		(void)endmntent(mtab_fd);
 	}
 
-        (void)endmntent(fstab_fd);
-	
 	add_node_contents(treeview, iter, &fstat_gdir);
 
 	gdirfree(&fstat_gdir);



More information about the Xfce4-dev mailing list