summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2022-09-05 13:08:54 +0200
committerJeremy Allison <jra@samba.org>2022-09-07 18:40:28 +0000
commitf14a45275be4a0276d6eaec77221e756035bcbf6 (patch)
tree24e643c5837991f0c847f0f85bccd13741ab13f1 /source3/torture
parent47e2df56f6d9534fb89cd18a939abe750ed8952c (diff)
downloadsamba-f14a45275be4a0276d6eaec77221e756035bcbf6.tar.gz
smbtorture3: Avoid an "else"
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 32ba9be5fb0..8e496320dda 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -7765,6 +7765,7 @@ static bool run_simple_posix_open_test(int dummy)
size_t nread;
const char *fname_windows = "windows_file";
uint16_t fnum2 = (uint16_t)-1;
+ bool ok;
printf("Starting simple POSIX open test\n");
@@ -8033,15 +8034,16 @@ static bool run_simple_posix_open_test(int dummy)
if (NT_STATUS_IS_OK(status)) {
printf("POSIX open of %s succeeded (should have failed)\n", sname);
goto out;
- } else {
- if (!check_both_error(__LINE__, status, ERRDOS, ERRbadpath,
- NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
- printf("POSIX open of %s should have failed "
- "with NT_STATUS_OBJECT_NAME_NOT_FOUND, "
- "failed with %s instead.\n",
- sname, nt_errstr(status));
- goto out;
- }
+ }
+ ok = check_both_error(
+ __LINE__, status, ERRDOS, ERRbadpath,
+ NT_STATUS_OBJECT_NAME_NOT_FOUND);
+ if (!ok) {
+ printf("POSIX open of %s should have failed "
+ "with NT_STATUS_OBJECT_NAME_NOT_FOUND, "
+ "failed with %s instead.\n",
+ sname, nt_errstr(status));
+ goto out;
}
status = cli_posix_readlink(cli1, sname, talloc_tos(), &target);