mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
libtt: pass proper flags to getfsstat, log error message and exit if it fails
This commit is contained in:
parent
ec4f0a93e8
commit
5669c8a60f
1 changed files with 6 additions and 2 deletions
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
#if defined(linux)
|
#if defined(linux)
|
||||||
# include <sys/poll.h>
|
# include <sys/poll.h>
|
||||||
#else
|
#else
|
||||||
|
@ -516,8 +517,11 @@ updateFileSystemEntries ()
|
||||||
int flags = MNT_NOWAIT;
|
int flags = MNT_NOWAIT;
|
||||||
char *s, *host, path[MNAMELEN] ;
|
char *s, *host, path[MNAMELEN] ;
|
||||||
|
|
||||||
numfs = getfsstat ( (struct statfs *)0, 0, 0 );
|
numfs = getfsstat ( (struct statfs *)0, 0, flags );
|
||||||
|
if(numfs == (-1)){
|
||||||
|
_tt_syslog(0,LOG_ERR,"getfsstat: %s",strerror(errno));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
bufsize = numfs * sizeof ( struct statfs );
|
bufsize = numfs * sizeof ( struct statfs );
|
||||||
buf = (struct statfs *) malloc ( bufsize );
|
buf = (struct statfs *) malloc ( bufsize );
|
||||||
memset ((void *)buf,0,bufsize);
|
memset ((void *)buf,0,bufsize);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue