summaryrefslogtreecommitdiffstats
path: root/source/libsmb/clireadwrite.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-08-27 17:52:23 +0000
committerAndrew Tridgell <tridge@samba.org>2001-08-27 17:52:23 +0000
commit1b778bc7d22efff3f90dc450eb12baa1241cf68f (patch)
tree6b1d11d27770295964ca18712ca841fc566db5b3 /source/libsmb/clireadwrite.c
parent83d9896c1ea8be796192b51a4678c2a3b87f7518 (diff)
downloadsamba-1b778bc7d22efff3f90dc450eb12baa1241cf68f.tar.gz
samba-1b778bc7d22efff3f90dc450eb12baa1241cf68f.tar.xz
samba-1b778bc7d22efff3f90dc450eb12baa1241cf68f.zip
started converting NTSTATUS to be a structure on systems with gcc in order to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs
Diffstat (limited to 'source/libsmb/clireadwrite.c')
-rw-r--r--source/libsmb/clireadwrite.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/libsmb/clireadwrite.c b/source/libsmb/clireadwrite.c
index 6566acf4efb..abbb8cd110d 100644
--- a/source/libsmb/clireadwrite.c
+++ b/source/libsmb/clireadwrite.c
@@ -110,16 +110,17 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_
errors. */
if (cli_is_error(cli)) {
- uint32 status = 0;
+ NTSTATUS status = NT_STATUS_OK;
uint8 eclass = 0;
+ uint32 ecode = 0;
if (cli_is_nt_error(cli))
status = cli_nt_error(cli);
else
- cli_dos_error(cli, &eclass, &status);
+ cli_dos_error(cli, &eclass, &ecode);
- if ((eclass == ERRDOS && status == ERRmoredata) ||
- status == STATUS_MORE_ENTRIES)
+ if ((eclass == ERRDOS && ecode == ERRmoredata) ||
+ NT_STATUS_V(status) == NT_STATUS_V(STATUS_MORE_ENTRIES))
return -1;
}