diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-06-15 14:15:48 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-06-15 14:15:48 +0000 |
commit | 9fd67b94a7e43c9dcbe098940b88879ae8743c00 (patch) | |
tree | 857185a3d5385ef98a9f5fa2fa75d4c9e499f529 | |
parent | fabe1f350e1fc58db33d22cebd38652950697ced (diff) | |
download | samba-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
-rw-r--r-- | source/smbd/open.c | 7 |
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) && |