xffm fstab changes

edscott wilson garcia edscott at imp.mx
Mon Apr 7 15:31:16 CEST 2003


El lun, 07-04-2003 a las 04:00, Benedikt Meurer escribió:
> On Mon, 07, Apr 2003, Benedikt Meurer wrote:
> 
> > On Sun, 06, Apr 2003, edscott wilson garcia wrote:
> > 
> > > Benny,
> > 
> > Edscott,
> > 
> > >   I've readded the macros that check for getmntinfo(). FreeBSD won't
> > > work because the open_fstab() falls into the "Solaris" section (it
> > > defines HAVE_GETVFSENT) but fails miserably with:
> > > fstab.c: In function `open_fstab':
> > > fstab.c:356: storage size of `vbuf' isn't known
> > > fstab.c:357: storage size of `mbuf' isn't known
> > > fstab.c:368: too many arguments to function `getvfsent'
> > > fstab.c:398: too many arguments to function `getvfsent'
> > > But the getmntinfo() works like a charm. I've also added a working
> > > is_mounted() function that works in both FreeBSD and Linux. With this
> > > function it is no longer necessary to flag the fstab entry as mounted or
> > > not (which is bugged, because another process can mount/unmount and
> > > render the flag useless). The is_mounted() function has 3 return values:
> > > 0 = not mounted 
> > > 1 = mounted
> > > -1 = can't tell (when this is returned, the "mounted" flag will be used)
> > 
> > Please don't use getmntinfo() if statfs() does the job. Please use
> > statfs() in is_mounted as shown in my example code.
> 
> And btw. Your is_mounted() routine won't work at all on Solaris. Please use
> the code I've put into #if 0/#endif instead.

I've put in the extra code that will work for Solaris at the
is_mounted() function, but have no means to test it. I've also changed
the order of the code so that Solaris code is last, otherwise FreeBSD
fails to work since it has vfs stuff different from Solaris. I think you
might need to add something so that the Solaris code is correctly
selected.

Edscott


> 
> > > It's also an exported function, because both the main menu and the popup
> > > menu now display either a "mount" or "unmount" item for each fstab
> > > entry. 
> > 
> > Nice.
> > 
> > > Also, I've changed instances where you wrote "sizeof(text)" with text as
> > > a character pointer (it causes bugs later down the road, so I avoid it).
> > > I always prefer strlen(text), but in this case I directly put in the
> > > array length.
> > 
> > I use sizeof() to determine the length of arrays (not pointers), since its
> > easier to read I think. But using the array length directly is ok :-).
> > 
> > One word about the autoconf stuff: I'm trying to get rid of most of the
> > unneccessary m4 macros in order to make the stuff maintainable. Therefore
> > I removed the references to the jm_* macros in the configure.ac (except for
> > the gnu strftime() stuff which is going to be fixed soon). You put that in
> > place again. Why?
> > 
> > > Edscott
> > 
> > regards,
> > Benedikt
> > 
> > -- 
> > Those who do not understand Unix are condemned to reinvent it, poorly.
> >     -- Henry Spencer
> > _______________________________________________
> > Xfce4-dev mailing list
> > Xfce4-dev at xfce.org
> > http://moongroup.com/mailman/listinfo/xfce4-dev
> 
> -- 
> Those who do not understand Unix are condemned to reinvent it, poorly.
>     -- Henry Spencer
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://moongroup.com/mailman/listinfo/xfce4-dev
> 





More information about the Xfce4-dev mailing list