Report an error on setmntent failure

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
Aaron Griffin 2007-03-29 22:44:10 -05:00
parent 970d2e942e
commit 1d35c4dcc6

View file

@ -560,11 +560,13 @@ cleanup:
static long long get_freespace() static long long get_freespace()
{ {
struct mntent *mnt; struct mntent *mnt;
char *table = MOUNTED; const char *table = MOUNTED;
FILE *fp; FILE *fp;
long long ret=0; long long ret=0;
if((fp = setmntent(table, "r")) == NULL) { if((fp = setmntent(table, "r")) == NULL) {
_alpm_log(PM_LOG_ERROR, _("cannot read disk space information from %s: %s"),
table, strerror(errno));
return(-1); return(-1);
} }