From c5285699d9cdfea1ce77955c311f08981a5a97ba Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 15 Jun 2000 14:15:48 +0000 Subject: 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) --- source3/smbd/open.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/smbd') 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) && -- cgit