summaryrefslogtreecommitdiffstats
path: root/bin/df
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
committersjg <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
commit62bb1062226d3ce6a2350808256a25508978352d (patch)
tree22b131dceb13c3df96da594fbaadb693504797c7 /bin/df
parent72ab90509b3a51ab361bf710338f2ef44a4e360d (diff)
parent04932445481c2cb89ff69a83b961bdef3d64757e (diff)
downloadFreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.zip
FreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.tar.gz
Merge from head
Diffstat (limited to 'bin/df')
-rw-r--r--bin/df/df.14
-rw-r--r--bin/df/df.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/bin/df/df.1 b/bin/df/df.1
index 8d14248..b5cf859 100644
--- a/bin/df/df.1
+++ b/bin/df/df.1
@@ -196,7 +196,9 @@ If the value is outside, it will be set to the appropriate limit.
.Xr localeconv 3 ,
.Xr fstab 5 ,
.Xr mount 8 ,
-.Xr quot 8 .
+.Xr pstat 8 ,
+.Xr quot 8 ,
+.Xr swapinfo 8 .
.Sh STANDARDS
With the exception of most options,
the
diff --git a/bin/df/df.c b/bin/df/df.c
index 77b7a40..13ef129 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -114,6 +114,7 @@ main(int argc, char *argv[])
fstype = "ufs";
(void)setlocale(LC_ALL, "");
+ memset(&maxwidths, 0, sizeof(maxwidths));
memset(&totalbuf, 0, sizeof(totalbuf));
totalbuf.f_bsize = DEV_BSIZE;
strlcpy(totalbuf.f_mntfromname, "total", MNAMELEN);
@@ -200,7 +201,7 @@ main(int argc, char *argv[])
} else {
/* just the filesystems specified on the command line */
mntbuf = malloc(argc * sizeof(*mntbuf));
- if (mntbuf == 0)
+ if (mntbuf == NULL)
err(1, "malloc()");
mntsize = 0;
/* continued in for loop below */
@@ -209,13 +210,13 @@ main(int argc, char *argv[])
/* iterate through specified filesystems */
for (; *argv; argv++) {
if (stat(*argv, &stbuf) < 0) {
- if ((mntpt = getmntpt(*argv)) == 0) {
+ if ((mntpt = getmntpt(*argv)) == NULL) {
warn("%s", *argv);
rv = 1;
continue;
}
} else if (S_ISCHR(stbuf.st_mode)) {
- if ((mntpt = getmntpt(*argv)) == 0) {
+ if ((mntpt = getmntpt(*argv)) == NULL) {
mdev.fspec = *argv;
mntpath = strdup("/tmp/df.XXXXXX");
if (mntpath == NULL) {
@@ -282,7 +283,7 @@ main(int argc, char *argv[])
mntbuf[mntsize++] = statfsbuf;
}
- bzero(&maxwidths, sizeof(maxwidths));
+ memset(&maxwidths, 0, sizeof(maxwidths));
for (i = 0; i < mntsize; i++) {
if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) {
update_maxwidths(&maxwidths, &mntbuf[i]);
@@ -309,7 +310,7 @@ getmntpt(const char *name)
if (!strcmp(mntbuf[i].f_mntfromname, name))
return (mntbuf[i].f_mntonname);
}
- return (0);
+ return (NULL);
}
/*
OpenPOWER on IntegriCloud