[libgtop] Log error on statvfs failure.
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgtop] Log error on statvfs failure.
- Date: Sun, 8 Dec 2013 23:58:38 +0000 (UTC)
commit 3147bf2e34f19e06ae21da768cc318bcc185f530
Author: Robert Roth <robert roth off gmail com>
Date: Mon Dec 9 01:57:01 2013 +0200
Log error on statvfs failure.
When doing stat on a FS and failing, log the error message based
on the errno set to help the user find the reason.
https://bugzilla.gnome.org/show_bug.cgi?id=685172
sysdeps/linux/fsusage.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/sysdeps/linux/fsusage.c b/sysdeps/linux/fsusage.c
index b186767..a7fd16c 100644
--- a/sysdeps/linux/fsusage.c
+++ b/sysdeps/linux/fsusage.c
@@ -15,6 +15,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <errno.h>
#include <mntent.h>
@@ -197,7 +198,7 @@ glibtop_get_fsusage_s(glibtop *server, glibtop_fsusage *buf, const char *path)
memset(buf, 0, sizeof(glibtop_fsusage));
if (statvfs(path, &fsd) < 0) {
- glibtop_warn_r(server, "statvfs '%s' failed", path);
+ glibtop_warn_r(server, "statvfs '%s' failed: %s", path, strerror (errno));
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]