Discussion:
df(1) - unneeded headers
Michal Mazurek
2016-02-08 14:13:55 UTC
Permalink
This was ok tb@ but never commited.


Remove uneeded includes, and sort those that can be sorted (some can't):

Index: df.c
===================================================================
RCS file: /cvs/src/bin/df/df.c,v
retrieving revision 1.54
diff -u -p -r1.54 df.c
--- df.c 9 Oct 2015 01:37:06 -0000 1.54
+++ df.c 1 Feb 2016 09:43:38 -0000
@@ -41,7 +41,6 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Index: ext2fs_df.c
===================================================================
RCS file: /cvs/src/bin/df/ext2fs_df.c,v
retrieving revision 1.14
diff -u -p -r1.14 ext2fs_df.c
--- ext2fs_df.c 27 Nov 2015 13:49:41 -0000 1.14
+++ ext2fs_df.c 1 Feb 2016 09:43:38 -0000
@@ -42,11 +42,8 @@
#include <sys/mount.h>
#include <ufs/ext2fs/ext2fs.h>
#include <ufs/ext2fs/ext2fs_dinode.h>
-#include <unistd.h>
-#include <stdlib.h>
+
#include <string.h>
-#include <fcntl.h>
-#include <fstab.h>

int e2fs_df(int, char *, struct statfs *);

Index: ffs_df.c
===================================================================
RCS file: /cvs/src/bin/df/ffs_df.c,v
retrieving revision 1.17
diff -u -p -r1.17 ffs_df.c
--- ffs_df.c 27 Nov 2015 13:49:41 -0000 1.17
+++ ffs_df.c 1 Feb 2016 09:43:38 -0000
@@ -36,13 +36,10 @@

#include <sys/types.h>
#include <sys/mount.h>
-#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
+#include <ufs/ufs/dinode.h>

-#include <unistd.h>
-#include <stdlib.h>
#include <string.h>
-#include <fcntl.h>

int ffs_df(int, char *, struct statfs *);
--
Michal Mazurek
Michael McConville
2016-02-08 16:27:04 UTC
Permalink
Committed (mostly). Thanks!

I left stdlib.h and unistd.h because I think that C99 requires that
those be included when using libc, although failing to do so is
non-fatal. You'll see warnings for this if you use a newer compiler and
build with -Wall.
Post by Michal Mazurek
Index: df.c
===================================================================
RCS file: /cvs/src/bin/df/df.c,v
retrieving revision 1.54
diff -u -p -r1.54 df.c
--- df.c 9 Oct 2015 01:37:06 -0000 1.54
+++ df.c 1 Feb 2016 09:43:38 -0000
@@ -41,7 +41,6 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Index: ext2fs_df.c
===================================================================
RCS file: /cvs/src/bin/df/ext2fs_df.c,v
retrieving revision 1.14
diff -u -p -r1.14 ext2fs_df.c
--- ext2fs_df.c 27 Nov 2015 13:49:41 -0000 1.14
+++ ext2fs_df.c 1 Feb 2016 09:43:38 -0000
@@ -42,11 +42,8 @@
#include <sys/mount.h>
#include <ufs/ext2fs/ext2fs.h>
#include <ufs/ext2fs/ext2fs_dinode.h>
-#include <unistd.h>
-#include <stdlib.h>
+
#include <string.h>
-#include <fcntl.h>
-#include <fstab.h>
int e2fs_df(int, char *, struct statfs *);
Index: ffs_df.c
===================================================================
RCS file: /cvs/src/bin/df/ffs_df.c,v
retrieving revision 1.17
diff -u -p -r1.17 ffs_df.c
--- ffs_df.c 27 Nov 2015 13:49:41 -0000 1.17
+++ ffs_df.c 1 Feb 2016 09:43:38 -0000
@@ -36,13 +36,10 @@
#include <sys/types.h>
#include <sys/mount.h>
-#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
+#include <ufs/ufs/dinode.h>
-#include <unistd.h>
-#include <stdlib.h>
#include <string.h>
-#include <fcntl.h>
int ffs_df(int, char *, struct statfs *);
--
Michal Mazurek
Loading...