summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-09-11 01:05:22 +0000
committerJeremy Allison <jra@samba.org>2002-09-11 01:05:22 +0000
commit99928976ea8994f1e759b652e6f06fdd86ffe853 (patch)
tree595ff4a1069aeb92accf4556fb3e25f65820b680 /source3/include
parent6b956c8c1e55723788ede2cf9307456b38165a3b (diff)
downloadsamba-99928976ea8994f1e759b652e6f06fdd86ffe853.tar.gz
samba-99928976ea8994f1e759b652e6f06fdd86ffe853.tar.bz2
samba-99928976ea8994f1e759b652e6f06fdd86ffe853.zip
Ensure we've failed a lock with a lock denied message before automatically
pushing it onto the blocking queue. Jeremy. (This used to be commit 237e36124cedf0485deaff81f34688fa862c3317)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/smb_macros.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index ccf151fab2..71d4bac795 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -80,17 +80,20 @@
#define FNUM_OK(fsp,c) (OPEN_FSP(fsp) && (c)==(fsp)->conn)
#define CHECK_FSP(fsp,conn) if (!FNUM_OK(fsp,conn)) \
- return(ERROR_DOS(ERRDOS,ERRbadfid)); \
- else if((fsp)->fd == -1) \
- return(ERROR_DOS(ERRDOS,ERRbadaccess))
+ return(ERROR_DOS(ERRDOS,ERRbadfid)); \
+ else if((fsp)->fd == -1) \
+ return(ERROR_DOS(ERRDOS,ERRbadaccess))
#define CHECK_READ(fsp) if (!(fsp)->can_read) \
- return(ERROR_DOS(ERRDOS,ERRbadaccess))
+ return(ERROR_DOS(ERRDOS,ERRbadaccess))
#define CHECK_WRITE(fsp) if (!(fsp)->can_write) \
- return(ERROR_DOS(ERRDOS,ERRbadaccess))
+ return(ERROR_DOS(ERRDOS,ERRbadaccess))
#define CHECK_ERROR(fsp) if (HAS_CACHED_ERROR(fsp)) \
- return(CACHED_ERROR(fsp))
+ return(CACHED_ERROR(fsp))
+
+#define ERROR_WAS_LOCK_DENIED(status) (NT_STATUS_EQUAL((status), NT_STATUS_LOCK_NOT_GRANTED) || \
+ NT_STATUS_EQUAL((status), NT_STATUS_FILE_LOCK_CONFLICT) )
/* translates a connection number into a service number */
#define SNUM(conn) ((conn)?(conn)->service:-1)