diff options
author | Jeremy Allison <jra@samba.org> | 2001-10-19 00:56:03 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-10-19 00:56:03 +0000 |
commit | 6cc3953196e3feb340f7b9b7bb823575414c5683 (patch) | |
tree | 28bf3943f76f952a8c2bb38e47dc22cadf38fffb /source3/include | |
parent | b49b5b94818827da43dee53346ced84c789fd73d (diff) | |
download | samba-6cc3953196e3feb340f7b9b7bb823575414c5683.tar.gz samba-6cc3953196e3feb340f7b9b7bb823575414c5683.tar.bz2 samba-6cc3953196e3feb340f7b9b7bb823575414c5683.zip |
Restored old Bmpx code - actually used by OS/2.
Jeremy.
(This used to be commit 7c1688fd67c1bda1477aaf870371c825280db870)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/smb.h | 1 | ||||
-rw-r--r-- | source3/include/smb_macros.h | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h index a805407b9f..fba08aed43 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -401,6 +401,7 @@ typedef struct files_struct SMB_OFF_T size; mode_t mode; uint16 vuid; + write_bmpx_struct *wbmpx_ptr; write_cache *wcp; struct timeval open_time; int share_mode; diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index b4264937cf..05a358573d 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -82,6 +82,9 @@ #define CHECK_WRITE(fsp) if (!(fsp)->can_write) \ return(ERROR_DOS(ERRDOS,ERRbadaccess)) +#define CHECK_ERROR(fsp) if (HAS_CACHED_ERROR(fsp)) \ + return(CACHED_ERROR(fsp)) + /* translates a connection number into a service number */ #define SNUM(conn) ((conn)?(conn)->service:-1) @@ -136,6 +139,15 @@ #define SMB_LARGE_LKLEN_OFFSET_HIGH(indx) (12 + (20 * (indx))) #define SMB_LARGE_LKLEN_OFFSET_LOW(indx) (16 + (20 * (indx))) +/* Macro to cache an error in a write_bmpx_struct */ +#define CACHE_ERROR(w,c,e) ((w)->wr_errclass = (c), (w)->wr_error = (e), \ + w->wr_discard = True, -1) +/* Macro to test if an error has been cached for this fnum */ +#define HAS_CACHED_ERROR(fsp) ((fsp)->wbmpx_ptr && \ + (fsp)->wbmpx_ptr->wr_discard) +/* Macro to turn the cached error into an error packet */ +#define CACHED_ERROR(fsp) cached_error_packet(outbuf,fsp,__LINE__,__FILE__) + /* these are the datagram types */ #define DGRAM_DIRECT_UNIQUE 0x10 |