aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-03-07 21:05:47 +0100
committerDuncaen <mail@duncano.de>2017-03-07 21:05:47 +0100
commit3d2480158bfbc26d3ac21728fc8d715209023f87 (patch)
tree41109b6fb60adb520ea3a1cfd0f5ccedf5967427
parentab3273a7e8d7a93ceccdf3ca2914542019a1e618 (diff)
downloadlobase-3d2480158bfbc26d3ac21728fc8d715209023f87.tar.gz
bin/df: activate and ifdef out raw device support
-rw-r--r--bin/Makefile1
-rw-r--r--bin/df/Makefile2
-rw-r--r--bin/df/df.c6
3 files changed, 7 insertions, 2 deletions
diff --git a/bin/Makefile b/bin/Makefile
index a691a27..bccaa47 100644
--- 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
index 9c6f241..1fb1a80 100644
--- 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
index 7eb8fc3..46c377d 100644
--- 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)