summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-09-03 20:10:25 +0000
committerJeremy Allison <jra@samba.org>2002-09-03 20:10:25 +0000
commitfedc33df428411fb8a58c4e9d2d7d8fa0e9d2923 (patch)
tree45f6594a3234a0b5eaeb02274af0f11376f91c43
parent0d9cde27370e3c6cc6df28c7ee8a32aa57e3ce42 (diff)
downloadsamba-fedc33df428411fb8a58c4e9d2d7d8fa0e9d2923.tar.gz
samba-fedc33df428411fb8a58c4e9d2d7d8fa0e9d2923.tar.bz2
samba-fedc33df428411fb8a58c4e9d2d7d8fa0e9d2923.zip
Ensure we open UNIX fifo's non-blocking like we used to do.
Jeremy. (This used to be commit 53f411df10f1e152d8d596cd24a2f66af9eb6e51)
-rw-r--r--source3/smbd/open.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 8cc73a681d..a95793a050 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -154,6 +154,17 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn,
local_flags &= ~O_TRUNC;
+#if defined(O_NONBLOCK) && defined(S_ISFIFO)
+ /*
+ * We would block on opening a FIFO with no one else on the
+ * other end. Do what we used to do and add O_NONBLOCK to the
+ * open flags. JRA.
+ */
+
+ if (VALID_STAT(*psbuf) && S_ISFIFO(psbuf->st_mode))
+ local_flags |= O_NONBLOCK;
+#endif
+
/* actually do the open */
fsp->fd = fd_open(conn, fname, local_flags, mode);