summaryrefslogtreecommitdiff
path: root/source3/smbd/error.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
commitee5f7237decfe446f4fdb08422beb2e6cb43af7f (patch)
tree80b217a2938d7e0d46a5d20517c9adb0807ecd1a /source3/smbd/error.c
parente8e98c9ea0690e3acf1126b50882e59e1056c7b3 (diff)
downloadsamba-ee5f7237decfe446f4fdb08422beb2e6cb43af7f.tar.gz
samba-ee5f7237decfe446f4fdb08422beb2e6cb43af7f.tar.bz2
samba-ee5f7237decfe446f4fdb08422beb2e6cb43af7f.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
(This used to be commit 1b778bc7d22efff3f90dc450eb12baa1241cf68f)
Diffstat (limited to 'source3/smbd/error.c')
-rw-r--r--source3/smbd/error.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/smbd/error.c b/source3/smbd/error.c
index 27dacda377..f2613dc3a8 100644
--- a/source3/smbd/error.c
+++ b/source3/smbd/error.c
@@ -84,14 +84,14 @@ int unix_error_packet(char *outbuf,int def_class,uint32 def_code,int line)
}
}
- return error_packet(outbuf,0,eclass,ecode,line);
+ return error_packet(outbuf,NT_STATUS_OK,eclass,ecode,line);
}
/****************************************************************************
create an error packet. Normally called using the ERROR() macro
****************************************************************************/
-int error_packet(char *outbuf,uint32 ntstatus,
+int error_packet(char *outbuf,NTSTATUS ntstatus,
uint8 eclass,uint32 ecode,int line)
{
int outsize = set_message(outbuf,0,0,True);
@@ -101,10 +101,10 @@ int error_packet(char *outbuf,uint32 ntstatus,
DEBUG(3,("error string = %s\n",strerror(errno)));
if (global_client_caps & CAP_STATUS32) {
- if (ntstatus == 0 && eclass) {
+ if (NT_STATUS_V(ntstatus) == 0 && eclass) {
ntstatus = dos_to_ntstatus(eclass, ecode);
}
- SIVAL(outbuf,smb_rcls,ntstatus);
+ SIVAL(outbuf,smb_rcls,NT_STATUS_V(ntstatus));
SSVAL(outbuf,smb_flg2, SVAL(outbuf,smb_flg2)|FLAGS2_32_BIT_ERROR_CODES);
DEBUG(3,("error packet at line %d cmd=%d (%s) %s\n",
line,
@@ -114,7 +114,7 @@ int error_packet(char *outbuf,uint32 ntstatus,
return outsize;
}
- if (eclass == 0 && ntstatus) {
+ if (eclass == 0 && NT_STATUS_V(ntstatus)) {
ntstatus_to_dos(ntstatus, &eclass, &ecode);
}