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 <david@fromorbit.com>
This commit is contained in:
Dave Chinner
2015-08-04 16:34:42 +10:00
parent 6834333589
commit 8c3016bc84
12 changed files with 28 additions and 6 deletions
+1
View File
@@ -18,6 +18,7 @@
#include <lib/hsm.h>
#include <unistd.h>
#include <string.h>
#include <malloc.h>
#include <getopt.h>
+1
View File
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <stdarg.h>
#include <ctype.h>
#include <lib/hsm.h>
+1
View File
@@ -17,6 +17,7 @@
*/
#include <lib/hsm.h>
#include <string.h>
/*---------------------------------------------------------------------------
@@ -18,8 +18,11 @@
#include <lib/hsm.h>
#include <unistd.h>
#include <getopt.h>
#include <string.h>
#include <fcntl.h>
/*---------------------------------------------------------------------------
+1
View File
@@ -16,6 +16,7 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
+1
View File
@@ -29,6 +29,7 @@
#include "global.h"
#include <stdarg.h>
#include <sys/uio.h> /* for struct iovec (readv)*/
#include <sys/mman.h> /* for mmap(2) */
#include <sys/ipc.h> /* for i/o buffer in shared memory */
+2
View File
@@ -3,12 +3,14 @@
* Test bulkstat doesn't returned unlinked inodes.
* Mark Goodwin <markgw@sgi.com> Fri Jul 20 09:13:57 EST 2007
*/
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <xfs/xfs.h>
#include <unistd.h>
#include <getopt.h>
#include <string.h>
int
main(int argc, char *argv[])
+2
View File
@@ -6,11 +6,13 @@
* This is a modified version of bulkstat_unlink_test.c to reproduce a specific
* problem see pv 969192
*/
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <xfs/xfs.h>
#include <unistd.h>
#include <string.h>
int
main(int argc, char *argv[])
+3
View File
@@ -16,6 +16,9 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <xfs/xfs.h>
+3 -3
View File
@@ -47,13 +47,13 @@ int argc;
char **argv;
{
int fd, err, elapsed;
char *buf, *goodbuf;
char *buf = NULL, *goodbuf = NULL;
time_t starttime;
char *filename="testfile";
int c;
if(argc != 3)
{ printf("Usage: trunc -f testfilename\n");
if (argc != 3) {
printf("Usage: trunc -f testfilename\n");
exit(1);
}
+2
View File
@@ -1,3 +1,5 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
+5
View File
@@ -16,7 +16,12 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <xfs/xfs.h>
#include <xfs/jdm.h>