From 116e3ef23c8ebefe60556a9e5a91388e9a9862d9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 18 Mar 2015 22:52:32 +0100 Subject: s4:torture/raw: avoid compiler warnings Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source4/torture/raw/samba3misc.c | 2 -- source4/torture/raw/search.c | 11 +++++++---- source4/torture/raw/streams.c | 9 +-------- 3 files changed, 8 insertions(+), 14 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c index a818c6bb484..95a82295d20 100644 --- a/source4/torture/raw/samba3misc.c +++ b/source4/torture/raw/samba3misc.c @@ -981,7 +981,6 @@ bool torture_samba3_rootdirfid(struct torture_context *tctx, struct smbcli_state bool torture_samba3_oplock_logoff(struct torture_context *tctx, struct smbcli_state *cli) { - uint16_t fnum1; union smb_open io; const char *fname = "testfile"; bool ret = false; @@ -1007,7 +1006,6 @@ bool torture_samba3_oplock_logoff(struct torture_context *tctx, struct smbcli_st torture_assert_ntstatus_equal_goto(tctx, smb_raw_open(cli->tree, tctx, &io), NT_STATUS_OK, ret, done, "first smb_open on the file failed"); - fnum1 = io.ntcreatex.out.file.fnum; /* * Create a conflicting open, causing the one-second delay diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index 0736c41d0cc..924c7f2bf6b 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -35,14 +35,17 @@ NT_STATUS_NOT_SUPPORTED) || \ NT_STATUS_EQUAL(__status, \ NT_STATUS_NOT_IMPLEMENTED)) { \ - torture_warning(__tctx, "(%s) Info " \ - "level "#__level" is %s", \ - __location__, nt_errstr(__status)); \ __supp = false; \ } else { \ + __supp = true; \ + } \ + if (__supp) { \ torture_assert_ntstatus_ok_goto(__tctx, \ __status, ret, done, #__level" failed"); \ - __supp = true; \ + } else { \ + torture_warning(__tctx, "(%s) Info " \ + "level "#__level" is %s", \ + __location__, nt_errstr(__status)); \ } \ } while (0) diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c index c1e502ff237..103a2c3057d 100644 --- a/source4/torture/raw/streams.c +++ b/source4/torture/raw/streams.c @@ -655,7 +655,7 @@ static bool test_stream_names(struct torture_context *tctx, const char *fname = BASEDIR "\\stream_names.txt"; const char *sname1, *sname1b, *sname1c, *sname1d; const char *sname2, *snamew, *snamew2; - const char *snamer1, *snamer2; + const char *snamer1; bool ret = true; int fnum1 = -1; int fnum2 = -1; @@ -692,7 +692,6 @@ static bool test_stream_names(struct torture_context *tctx, snamew = talloc_asprintf(tctx, "%s:%s:$DATA", fname, "?Stream*"); snamew2 = talloc_asprintf(tctx, "%s\\stream*:%s:$DATA", BASEDIR, "?Stream*"); snamer1 = talloc_asprintf(tctx, "%s:%s:$DATA", fname, "BeforeRename"); - snamer2 = talloc_asprintf(tctx, "%s:%s:$DATA", fname, "AfterRename"); printf("(%s) testing stream names\n", __location__); io.generic.level = RAW_OPEN_NTCREATEX; @@ -1090,8 +1089,6 @@ done: } #define CHECK_CALL_FNUM(call, rightstatus) do { \ - check_fnum = true; \ - call_name = #call; \ sfinfo.generic.level = RAW_SFILEINFO_ ## call; \ sfinfo.generic.in.file.fnum = fnum; \ status = smb_raw_setfileinfo(cli->tree, &sfinfo); \ @@ -1122,8 +1119,6 @@ static bool test_stream_rename(struct torture_context *tctx, union smb_setfileinfo sfinfo; bool ret = true; int fnum = -1; - bool check_fnum; - const char *call_name; torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); @@ -1398,8 +1393,6 @@ static bool test_stream_rename3(struct torture_context *tctx, bool ret = true; int fnum = -1; int fnum2 = -1; - bool check_fnum; - const char *call_name; torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); -- cgit v1.2.1