diff options
author | Jeremy Allison <jra@samba.org> | 2009-04-30 15:26:43 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-04-30 15:26:43 -0700 |
commit | 8cf78ff55312768d0b454b1d7e0560e04e6296da (patch) | |
tree | 0a2180f063e3bb9872c2565c92075dfb5dccac81 /source3/torture/nbio.c | |
parent | ab4b8c9c0438bc5afca17e3ebf05dde6f98bc0aa (diff) | |
download | samba-8cf78ff55312768d0b454b1d7e0560e04e6296da.tar.gz samba-8cf78ff55312768d0b454b1d7e0560e04e6296da.tar.bz2 samba-8cf78ff55312768d0b454b1d7e0560e04e6296da.zip |
Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int.
Convert all uses of cli_open(), cli_nt_createXXX to NTSTATUS versions.
This is smaller than it looks, it just fixes a lot of old code.
Next up, ensure all cli_XX functions return NTSTATUS.
Jeremy.
Diffstat (limited to 'source3/torture/nbio.c')
-rw-r--r-- | source3/torture/nbio.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c index 1542a8ffb4..c5a5388f08 100644 --- a/source3/torture/nbio.c +++ b/source3/torture/nbio.c @@ -140,7 +140,9 @@ void nb_unlink(const char *fname) void nb_createx(const char *fname, unsigned create_options, unsigned create_disposition, int handle) { - int fd, i; + uint16_t fd = (uint16_t)-1; + int i; + NTSTATUS status; uint32 desired_access; if (create_options & FILE_DIRECTORY_FILE) { @@ -149,22 +151,22 @@ void nb_createx(const char *fname, desired_access = FILE_READ_DATA | FILE_WRITE_DATA; } - fd = cli_nt_create_full(c, fname, 0, + status = cli_ntcreate(c, fname, 0, desired_access, 0x0, FILE_SHARE_READ|FILE_SHARE_WRITE, create_disposition, - create_options, 0); - if (fd == -1 && handle != -1) { - printf("ERROR: cli_nt_create_full failed for %s - %s\n", + create_options, 0, &fd); + if (!NT_STATUS_IS_OK(status) && handle != -1) { + printf("ERROR: cli_ntcreate failed for %s - %s\n", fname, cli_errstr(c)); exit(1); } - if (fd != -1 && handle == -1) { - printf("ERROR: cli_nt_create_full succeeded for %s\n", fname); + if (NT_STATUS_IS_OK(status) && handle == -1) { + printf("ERROR: cli_ntcreate succeeded for %s\n", fname); exit(1); } - if (fd == -1) return; + if (fd == (uint16_t)-1) return; for (i=0;i<MAX_FILES;i++) { if (ftable[i].handle == 0) break; |