s3: Fix error logic in posix_open
[kai/samba.git] / source3 / client / client.c
index aa890bab4c496036cd652ed769fdab9867a0b209..978f2e5dd69481051b737540a35837069f2a6b36 100644 (file)
@@ -2572,9 +2572,9 @@ static int cmd_posix_open(void)
 
        if (!NT_STATUS_IS_OK(cli_posix_open(targetcli, targetname, O_CREAT|O_RDWR, mode, &fnum))) {
                if (!NT_STATUS_IS_OK(cli_posix_open(targetcli, targetname, O_CREAT|O_RDONLY, mode, &fnum))) {
-                       d_printf("posix_open file %s: for read/write fnum %d\n", targetname, fnum);
-               } else {
                        d_printf("Failed to open file %s. %s\n", targetname, cli_errstr(cli));
+               } else {
+                       d_printf("posix_open file %s: for readonly fnum %d\n", targetname, fnum);
                }
        } else {
                d_printf("posix_open file %s: for read/write fnum %d\n", targetname, fnum);