Don't list dummy rootfs by default
This commit is contained in:
parent
7cd9280b11
commit
ee88227c33
9
df.c
9
df.c
@ -2,6 +2,7 @@
|
|||||||
#include <mntent.h>
|
#include <mntent.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@ -18,9 +19,11 @@ main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
struct mntent *me = NULL;
|
struct mntent *me = NULL;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
int aflag = 0;
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
case 'a':
|
case 'a':
|
||||||
|
aflag = 1;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
case 'h':
|
case 'h':
|
||||||
@ -35,8 +38,12 @@ main(int argc, char *argv[])
|
|||||||
fp = setmntent("/proc/mounts", "r");
|
fp = setmntent("/proc/mounts", "r");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
eprintf("setmntent %s:", "/proc/mounts");
|
eprintf("setmntent %s:", "/proc/mounts");
|
||||||
while ((me = getmntent(fp)) != NULL)
|
while ((me = getmntent(fp)) != NULL) {
|
||||||
|
if (aflag == 0)
|
||||||
|
if (strcmp(me->mnt_type, "rootfs") == 0)
|
||||||
|
continue;
|
||||||
mnt_show(me->mnt_fsname, me->mnt_dir);
|
mnt_show(me->mnt_fsname, me->mnt_dir);
|
||||||
|
}
|
||||||
endmntent(fp);
|
endmntent(fp);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user