aboutsummaryrefslogtreecommitdiff
path: root/bin/df/df.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/df/df.c')
-rw-r--r--bin/df/df.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/bin/df/df.c b/bin/df/df.c
index 627d8b1c861d..db5b8b18beae 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -34,25 +34,10 @@
* SUCH DAMAGE.
*/
-#if 0
-#ifndef lint
-static const char copyright[] =
-"@(#) Copyright (c) 1980, 1990, 1993, 1994\n\
- The Regents of the University of California. All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-static char sccsid[] = "@(#)df.c 8.9 (Berkeley) 5/8/95";
-#endif /* not lint */
-#endif
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#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 +189,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- rv = 0;
+ rv = EXIT_SUCCESS;
if (!*argv) {
/* everything (modulo -t) */
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
@@ -226,14 +211,14 @@ main(int argc, char *argv[])
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 +231,7 @@ main(int argc, char *argv[])
*/
if (statfs(mntpt, &statfsbuf) < 0) {
xo_warn("%s", mntpt);
- rv = 1;
+ rv = EXIT_FAILURE;
continue;
}
@@ -257,7 +242,7 @@ main(int argc, char *argv[])
* we've been given (-l, -t, etc.).
*/
if (checkvfsselected(statfsbuf.f_fstypename) != 0) {
- rv = 1;
+ rv = EXIT_FAILURE;
continue;
}
@@ -286,7 +271,8 @@ main(int argc, char *argv[])
prtstat(&totalbuf, &maxwidths);
xo_close_container("storage-system-information");
- xo_finish();
+ if (xo_finish() < 0)
+ rv = EXIT_FAILURE;
exit(rv);
}
@@ -322,7 +308,7 @@ makevfslist(char *fslist, int *skip)
if (*nextcp == ',')
i++;
if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) {
- warnx("malloc failed");
+ xo_warnx("malloc failed");
return (NULL);
}
nextcp = fslist;