From: Dave Chinner Date: Tue, 4 Aug 2015 06:34:42 +0000 (+1000) Subject: xfstests: fix build errors and warnings X-Git-Tag: v2022.05.01~2822 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8c3016bc8446f2c3079d2665960d0a2ae980713c;p=users%2Fhch%2Fxfstests-dev.git xfstests: fix build errors and warnings After upgrading userspace on test machines to xfsprogs-4.2.0-rc1, lots of build warnings and failures are exposed from implicit includes that no longer exist. Hence these need fixing to allow fstests to build correctly. gcc also seems to have grown new stupidities around uninitialised variables, so fix them while touching the same files. Signed-off-by: Dave Chinner --- diff --git a/dmapi/src/common/cmd/write_invis.c b/dmapi/src/common/cmd/write_invis.c index 28744ac5d..b0b2af621 100644 --- a/dmapi/src/common/cmd/write_invis.c +++ b/dmapi/src/common/cmd/write_invis.c @@ -18,6 +18,7 @@ #include +#include #include #include #include diff --git a/dmapi/src/common/lib/util.c b/dmapi/src/common/lib/util.c index 2ee7c33cf..8a256b314 100644 --- a/dmapi/src/common/lib/util.c +++ b/dmapi/src/common/lib/util.c @@ -23,6 +23,7 @@ #include #include +#include #include diff --git a/dmapi/src/suite1/cmd/get_dirattrs.c b/dmapi/src/suite1/cmd/get_dirattrs.c index 49ac356e9..a7e671ef3 100644 --- a/dmapi/src/suite1/cmd/get_dirattrs.c +++ b/dmapi/src/suite1/cmd/get_dirattrs.c @@ -17,6 +17,7 @@ */ #include +#include /*--------------------------------------------------------------------------- diff --git a/dmapi/src/suite1/cmd/probe_punch_xfsctl_hole.c b/dmapi/src/suite1/cmd/probe_punch_xfsctl_hole.c index c01dff005..855c5f60d 100644 --- a/dmapi/src/suite1/cmd/probe_punch_xfsctl_hole.c +++ b/dmapi/src/suite1/cmd/probe_punch_xfsctl_hole.c @@ -18,8 +18,11 @@ #include +#include #include #include +#include + /*--------------------------------------------------------------------------- diff --git a/dmapi/src/suite2/src/test_dmattr.c b/dmapi/src/suite2/src/test_dmattr.c index cf870772c..a8a059580 100644 --- a/dmapi/src/suite2/src/test_dmattr.c +++ b/dmapi/src/suite2/src/test_dmattr.c @@ -16,6 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include diff --git a/ltp/doio.c b/ltp/doio.c index 966cff1d7..dcb3efd8c 100644 --- a/ltp/doio.c +++ b/ltp/doio.c @@ -29,6 +29,7 @@ #include "global.h" +#include #include /* for struct iovec (readv)*/ #include /* for mmap(2) */ #include /* for i/o buffer in shared memory */ diff --git a/src/bulkstat_unlink_test.c b/src/bulkstat_unlink_test.c index afd69ffec..cdf720efc 100644 --- a/src/bulkstat_unlink_test.c +++ b/src/bulkstat_unlink_test.c @@ -3,12 +3,14 @@ * Test bulkstat doesn't returned unlinked inodes. * Mark Goodwin Fri Jul 20 09:13:57 EST 2007 */ +#include #include #include #include #include #include #include +#include int main(int argc, char *argv[]) diff --git a/src/bulkstat_unlink_test_modified.c b/src/bulkstat_unlink_test_modified.c index 3a50d61bf..660499261 100644 --- a/src/bulkstat_unlink_test_modified.c +++ b/src/bulkstat_unlink_test_modified.c @@ -6,11 +6,13 @@ * This is a modified version of bulkstat_unlink_test.c to reproduce a specific * problem see pv 969192 */ +#include #include #include #include #include #include +#include int main(int argc, char *argv[]) diff --git a/src/iopat.c b/src/iopat.c index f34de19c6..7383af506 100644 --- a/src/iopat.c +++ b/src/iopat.c @@ -16,6 +16,9 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include +#include #include #include #include diff --git a/src/trunc.c b/src/trunc.c index c60985238..2b35d1ef3 100644 --- a/src/trunc.c +++ b/src/trunc.c @@ -47,17 +47,17 @@ int argc; char **argv; { int fd, err, elapsed; - char *buf, *goodbuf; + char *buf = NULL, *goodbuf = NULL; time_t starttime; char *filename="testfile"; - int c; + int c; -if(argc != 3) - { printf("Usage: trunc -f testfilename\n"); - exit(1); + if (argc != 3) { + printf("Usage: trunc -f testfilename\n"); + exit(1); } -while((c=getopt(argc,argv,"f:"))!=EOF) { + while((c=getopt(argc,argv,"f:"))!=EOF) { switch (c) { case 'f': filename = optarg; diff --git a/src/unwritten_sync.c b/src/unwritten_sync.c index bf61adf07..ebdc8248b 100644 --- a/src/unwritten_sync.c +++ b/src/unwritten_sync.c @@ -1,3 +1,5 @@ +#include +#include #include #include #include diff --git a/src/xfsctl.c b/src/xfsctl.c index 3f82f4adb..bf2a873a1 100644 --- a/src/xfsctl.c +++ b/src/xfsctl.c @@ -16,7 +16,12 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include +#include #include +#include +#include #include #include