Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148098143
D38097.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38097.diff
View Options
diff --git a/bin/df/df.c b/bin/df/df.c
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -52,7 +52,6 @@
#include <sys/stat.h>
#include <sys/mount.h>
#include <sys/sysctl.h>
-#include <err.h>
#include <getopt.h>
#include <libutil.h>
#include <locale.h>
@@ -204,7 +203,7 @@
argc -= optind;
argv += optind;
- rv = 0;
+ rv = EXIT_SUCCESS;
if (!*argv) {
/* everything (modulo -t) */
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
@@ -226,14 +225,14 @@
if (stat(*argv, &stbuf) < 0) {
if ((mntpt = getmntpt(*argv)) == NULL) {
xo_warn("%s", *argv);
- rv = 1;
+ rv = EXIT_FAILURE;
continue;
}
} else if (S_ISCHR(stbuf.st_mode)) {
mntpt = getmntpt(*argv);
if (mntpt == NULL) {
xo_warnx("%s: not mounted", *argv);
- rv = 1;
+ rv = EXIT_FAILURE;
continue;
}
} else {
@@ -246,7 +245,7 @@
*/
if (statfs(mntpt, &statfsbuf) < 0) {
xo_warn("%s", mntpt);
- rv = 1;
+ rv = EXIT_FAILURE;
continue;
}
@@ -257,7 +256,7 @@
* we've been given (-l, -t, etc.).
*/
if (checkvfsselected(statfsbuf.f_fstypename) != 0) {
- rv = 1;
+ rv = EXIT_FAILURE;
continue;
}
@@ -286,7 +285,8 @@
prtstat(&totalbuf, &maxwidths);
xo_close_container("storage-system-information");
- xo_finish();
+ if (xo_finish() < 0)
+ rv = EXIT_FAILURE;
exit(rv);
}
@@ -322,7 +322,7 @@
if (*nextcp == ',')
i++;
if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) {
- warnx("malloc failed");
+ xo_warnx("malloc failed");
return (NULL);
}
nextcp = fslist;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 16, 6:16 PM (11 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29780899
Default Alt Text
D38097.diff (1 KB)
Attached To
Mode
D38097: df: Return non-zero status on write failure.
Attached
Detach File
Event Timeline
Log In to Comment