xffm fstab changes
edscott wilson garcia
edscott at imp.mx
Mon Apr 7 04:32:43 CEST 2003
Benny,
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)
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.
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.
Edscott
More information about the Xfce4-dev
mailing list