Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Add warn() and die()
[slstatus.git]
/
components
/
disk.c
diff --git
a/components/disk.c
b/components/disk.c
index
bf69875
..
f4031ea
100644
(file)
--- a/
components/disk.c
+++ b/
components/disk.c
@@
-12,7
+12,7
@@
disk_free(const char *mnt)
struct statvfs fs;
if (statvfs(mnt, &fs) < 0) {
struct statvfs fs;
if (statvfs(mnt, &fs) < 0) {
-
fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno)
);
+
warn("statvfs '%s':", mnt
);
return NULL;
}
return NULL;
}
@@
-26,7
+26,7
@@
disk_perc(const char *mnt)
struct statvfs fs;
if (statvfs(mnt, &fs) < 0) {
struct statvfs fs;
if (statvfs(mnt, &fs) < 0) {
-
fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno)
);
+
warn("statvfs '%s':", mnt
);
return NULL;
}
return NULL;
}
@@
-40,7
+40,7
@@
disk_total(const char *mnt)
struct statvfs fs;
if (statvfs(mnt, &fs) < 0) {
struct statvfs fs;
if (statvfs(mnt, &fs) < 0) {
-
fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno)
);
+
warn("statvfs '%s':", mnt
);
return NULL;
}
return NULL;
}
@@
-54,7
+54,7
@@
disk_used(const char *mnt)
struct statvfs fs;
if (statvfs(mnt, &fs) < 0) {
struct statvfs fs;
if (statvfs(mnt, &fs) < 0) {
-
fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno)
);
+
warn("statvfs '%s':", mnt
);
return NULL;
}
return NULL;
}