From: alx Date: Sat, 29 Jul 2017 13:10:54 +0000 (+0200) Subject: libtt: pass proper flags to getfsstat, log error message and exit if it fails X-Git-Tag: 2.2.4a~195 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5669c8a60f67cc35c58d201e982dccdc4c074592;p=oweals%2Fcde.git libtt: pass proper flags to getfsstat, log error message and exit if it fails --- diff --git a/cde/lib/tt/lib/util/tt_file_system.C b/cde/lib/tt/lib/util/tt_file_system.C index ef6924d7..05c81b71 100644 --- a/cde/lib/tt/lib/util/tt_file_system.C +++ b/cde/lib/tt/lib/util/tt_file_system.C @@ -46,6 +46,7 @@ #include #include +#include #if defined(linux) # include #else @@ -516,8 +517,11 @@ updateFileSystemEntries () int flags = MNT_NOWAIT; 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 ); buf = (struct statfs *) malloc ( bufsize ); memset ((void *)buf,0,bufsize);