torture: Fix clang errors
authorVolker Lendecke <vl@samba.org>
Tue, 18 Oct 2016 11:27:00 +0000 (13:27 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 19 Oct 2016 03:11:25 +0000 (05:11 +0200)
h1.data is an array and as such always is != NULL, so it's always true

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct 19 05:11:25 CEST 2016 on sn-devel-144

source4/torture/smb2/rename.c
source4/torture/vfs/fruit.c

index 23fe4f9494fe463f998808c5dbe6fc1aeea7b631..1a490f31240646a414097c922e03a3a7c49e0b42 100644 (file)
@@ -120,7 +120,7 @@ done:
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (h1.data) {
+       if (h1.data[0] || h1.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = h1;
@@ -199,7 +199,7 @@ done:
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (h1.data) {
+       if (h1.data[0] || h1.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = h1;
@@ -288,7 +288,7 @@ done:
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (h1.data) {
+       if (h1.data[0] || h1.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = h1;
@@ -405,13 +405,13 @@ done:
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (fh.data) {
+       if (fh.data[0] || fh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = fh;
                status = smb2_close(tree1, &(cl.smb2));
        }
-       if (dh.data) {
+       if (dh.data[0] || dh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = dh;
@@ -529,13 +529,13 @@ done:
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (fh.data) {
+       if (fh.data[0] || fh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = fh;
                status = smb2_close(tree1, &(cl.smb2));
        }
-       if (dh.data) {
+       if (dh.data[0] || dh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = dh;
@@ -663,13 +663,13 @@ done:
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (fh.data) {
+       if (fh.data[0] || fh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = fh;
                status = smb2_close(tree1, &(cl.smb2));
        }
-       if (dh.data) {
+       if (dh.data[0] || dh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = dh;
@@ -787,13 +787,13 @@ done:
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (fh.data) {
+       if (fh.data[0] || fh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = fh;
                status = smb2_close(tree1, &(cl.smb2));
        }
-       if (dh.data) {
+       if (dh.data[0] || dh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = dh;
@@ -911,13 +911,13 @@ done:
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (fh.data) {
+       if (fh.data[0] || fh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = fh;
                status = smb2_close(tree1, &(cl.smb2));
        }
-       if (dh.data) {
+       if (dh.data[0] || dh.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = dh;
@@ -1011,7 +1011,7 @@ done:
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (h1.data) {
+       if (h1.data[0] || h1.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = h1;
index 020bd1f42d86d8202bc4870bf4db32dc151f380a..d5de9d5c805f1b6567455fe02712a0c93a573983 100644 (file)
@@ -2841,7 +2841,7 @@ static bool test_rename_dir_openfile(struct torture_context *torture,
 
        torture_comment(torture, "Cleaning up\n");
 
-       if (h1.data) {
+       if (h1.data[0] || h1.data[1]) {
                ZERO_STRUCT(cl.smb2);
                cl.smb2.level = RAW_CLOSE_SMB2;
                cl.smb2.in.file.handle = h1;