From fedc33df428411fb8a58c4e9d2d7d8fa0e9d2923 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 Sep 2002 20:10:25 +0000 Subject: Ensure we open UNIX fifo's non-blocking like we used to do. Jeremy. (This used to be commit 53f411df10f1e152d8d596cd24a2f66af9eb6e51) --- source3/smbd/open.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); -- cgit