summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-03-31 16:56:21 -0700
committerJeremy Allison <jra@samba.org>2008-03-31 16:56:21 -0700
commit6913f1013456be8938bb71b3d8968170e50933e7 (patch)
treec888bd9b0762e2128429c4a2459e389bb4a6da79 /source3
parente11cd466e1b6beae82fa0117c300669b8eff7f0a (diff)
downloadsamba-6913f1013456be8938bb71b3d8968170e50933e7.tar.gz
samba-6913f1013456be8938bb71b3d8968170e50933e7.tar.bz2
samba-6913f1013456be8938bb71b3d8968170e50933e7.zip
Move the message_dispatch() call after the check for errno on
the select return. We don't want the call to message_dispatch to mess up the errno value. Jeremy. (This used to be commit 26a74d01bb2b53ffa5d296ff1c7d8b2b0d17831a)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/process.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 03216a0700..9aa775d0f6 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -853,15 +853,6 @@ static NTSTATUS receive_message_or_smb(TALLOC_CTX *mem_ctx, char **buffer,
goto again;
}
- /*
- * We've just woken up from a protentially long select sleep.
- * Ensure we process local messages as we need to synchronously
- * process any messages from other smbd's to avoid file rename race
- * conditions. This call is cheap if there are no messages waiting.
- * JRA.
- */
- message_dispatch(smbd_messaging_context());
-
/* if we get EINTR then maybe we have received an oplock
signal - treat this as select returning 1. This is ugly, but
is the best we can do until the oplock code knows more about
@@ -880,8 +871,17 @@ static NTSTATUS receive_message_or_smb(TALLOC_CTX *mem_ctx, char **buffer,
if (selrtn == -1) {
/* something is wrong. Maybe the socket is dead? */
return map_nt_error_from_unix(errno);
- }
-
+ }
+
+ /*
+ * We've just woken up from a protentially long select sleep.
+ * Ensure we process local messages as we need to synchronously
+ * process any messages from other smbd's to avoid file rename race
+ * conditions. This call is cheap if there are no messages waiting.
+ * JRA.
+ */
+ message_dispatch(smbd_messaging_context());
+
/* Did we timeout ? */
if (selrtn == 0) {
return NT_STATUS_IO_TIMEOUT;