summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-06-15 14:15:48 +0000
committerAndrew Tridgell <tridge@samba.org>2000-06-15 14:15:48 +0000
commitc5285699d9cdfea1ce77955c311f08981a5a97ba (patch)
tree59c0352cbd49cf86fb2fd4a5afecf3247e8a9d91
parentf94f053b7618157f6caaa1d65553c1abb3aba917 (diff)
downloadsamba-c5285699d9cdfea1ce77955c311f08981a5a97ba.tar.gz
samba-c5285699d9cdfea1ce77955c311f08981a5a97ba.tar.bz2
samba-c5285699d9cdfea1ce77955c311f08981a5a97ba.zip
open files with O_NONBLOCK when available. This is necessary to
prevent possible deadlocks with kernel leases and harmless when kernel leases are not used. basically we don't ever want smbd to block (This used to be commit 9fd67b94a7e43c9dcbe098940b88879ae8743c00)
-rw-r--r--source3/smbd/open.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 5a0493e625..e9d2f01e10 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -36,7 +36,12 @@ extern BOOL global_client_failed_oplock_break;
static int fd_open(struct connection_struct *conn, char *fname,
int flags, mode_t mode)
{
- int fd = conn->vfs_ops.open(dos_to_unix(fname,False),flags,mode);
+ int fd;
+#ifdef O_NONBLOCK
+ flags |= O_NONBLOCK;
+#endif
+
+ fd = conn->vfs_ops.open(dos_to_unix(fname,False),flags,mode);
/* Fix for files ending in '.' */
if((fd == -1) && (errno == ENOENT) &&