lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit 3d2480158bfbc26d3ac21728fc8d715209023f87
parent ab3273a7e8d7a93ceccdf3ca2914542019a1e618
Author: Duncaen <mail@duncano.de>
Date:   Tue,  7 Mar 2017 21:05:47 +0100

bin/df: activate and ifdef out raw device support

Diffstat:
bin/Makefile | 1-
bin/df/Makefile | 2+-
bin/df/df.c | 6++++++
3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/bin/Makefile b/bin/Makefile @@ -1,4 +1,3 @@ SUBDIR = cat chmod cp date dd df domainname echo ed expr hostname kill ln ls \ md5 mkdir mv pax pwd rm rmdir sleep stty sync test -SKIPDIR = df include bsd.subdir.mk diff --git a/bin/df/Makefile b/bin/df/Makefile @@ -1,7 +1,7 @@ # $OpenBSD: Makefile,v 1.8 2003/05/26 18:02:32 ian Exp $ PROG= df -SRCS= df.c ffs_df.c ext2fs_df.c +SRCS= df.c LDADD= -lutil DPADD= ${LIBUTIL} diff --git a/bin/df/df.c b/bin/df/df.c @@ -59,9 +59,11 @@ static long regetmntinfo(struct statfs **, long); static int selected(const char *); static __dead void usage(void); +#ifdef __OpenBSD__ extern int e2fs_df(int, char *, struct statfs *); extern int ffs_df(int, char *, struct statfs *); static int raw_df(char *, struct statfs *); +#endif int hflag, iflag, kflag, lflag, nflag, Pflag; char **typelist = NULL; @@ -135,8 +137,10 @@ main(int argc, char *argv[]) continue; } } else if (S_ISCHR(stbuf.st_mode) || S_ISBLK(stbuf.st_mode)) { +#ifdef __OpenBSD__ if (!raw_df(*argv, &mntbuf[mntsize])) ++mntsize; +#endif continue; } else mntpt = *argv; @@ -416,6 +420,7 @@ posixprint(struct statfs *mntbuf, long mntsize, int maxwidth) } } +#ifdef __OpenBSD__ static int raw_df(char *file, struct statfs *sfsp) { @@ -435,6 +440,7 @@ raw_df(char *file, struct statfs *sfsp) close (rfd); return (ret); } +#endif int bread(int rfd, off_t off, void *buf, int cnt)