From 73d407968002587eadd0ff13eb413ddf07c78771 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 3 Nov 2007 15:12:42 -0700 Subject: Remove the smb_read_error global variable and replace it with accessor functions. "One global or pstring a day...." :-). Jeremy. (This used to be commit d50d14c300abc83b7015718ec48acc8b3227a273) --- source3/include/client.h | 3 ++- source3/include/smb.h | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index e38017fe7b..d8c35780a4 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -82,7 +82,8 @@ struct rpc_pipe_client { struct cli_state { int port; int fd; - int smb_rw_error; /* Copy of last read or write error. */ + /* Copy of last read or write error. */ + enum smb_read_errors smb_rw_error; uint16 cnum; uint16 pid; uint16 mid; diff --git a/source3/include/smb.h b/source3/include/smb.h index 303f7606d3..be339f2e38 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -72,12 +72,15 @@ #include "debug.h" /* this defines the error codes that receive_smb can put in smb_read_error */ -#define READ_TIMEOUT 1 -#define READ_EOF 2 -#define READ_ERROR 3 -#define WRITE_ERROR 4 /* This error code can go into the client smb_rw_error. */ -#define READ_BAD_SIG 5 -#define DO_NOT_DO_TDIS 6 /* cli_close_connection() check for this when smbfs wants to keep tree connected */ +enum smb_read_errors { + SMB_READ_OK = 0, + SMB_READ_TIMEOUT, + SMB_READ_EOF, + SMB_READ_ERROR, + SMB_WRITE_ERROR, /* This error code can go into the client smb_rw_error. */ + SMB_READ_BAD_SIG, + SMB_DO_NOT_DO_TDIS /* cli_close_connection() check for this when smbfs wants to keep tree connected */ +}; #define DIR_STRUCT_SIZE 43 -- cgit