summaryrefslogtreecommitdiffstats
path: root/source/smbd/open.c
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
commit9fd67b94a7e43c9dcbe098940b88879ae8743c00 (patch)
tree857185a3d5385ef98a9f5fa2fa75d4c9e499f529 /source/smbd/open.c
parentfabe1f350e1fc58db33d22cebd38652950697ced (diff)
downloadsamba-9fd67b94a7e43c9dcbe098940b88879ae8743c00.tar.gz
samba-9fd67b94a7e43c9dcbe098940b88879ae8743c00.tar.xz
samba-9fd67b94a7e43c9dcbe098940b88879ae8743c00.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
Diffstat (limited to 'source/smbd/open.c')
-rw-r--r--source/smbd/open.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 5a0493e625f..e9d2f01e104 100644
--- a/source/smbd/open.c
+++ b/source/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) &&