]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Don't try to set /dev/null fd nonblocking, all systems don't like that.
authorTimo Sirainen <tss@iki.fi>
Sun, 4 May 2003 16:16:26 +0000 (19:16 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 May 2003 16:16:26 +0000 (19:16 +0300)
--HG--
branch : HEAD

src/master/main.c

index 4a05f85e802612bb371326d2d23d4cb1ab87d957..f469451599a83b7863ed5e4e9af60075d57e4405 100644 (file)
@@ -264,10 +264,16 @@ static void listen_protocols(void)
                if (*fd != -1)
                        i_fatal("Protocol %s given more than once", *proto);
 
-               *fd = port == 0 ? dup(null_fd) : net_listen(ip, &port);
-               if (*fd == -1)
-                       i_fatal("listen(%d) failed: %m", port);
-               net_set_nonblock(*fd, TRUE);
+               if (port == 0) {
+                       *fd = dup(null_fd);
+                       if (*fd == -1)
+                               i_fatal("dup(null_fd) failed: %m");
+               } else {
+                       *fd = net_listen(ip, &port);
+                       if (*fd == -1)
+                               i_fatal("listen(%d) failed: %m", port);
+                       net_set_nonblock(*fd, TRUE);
+               }
                fd_close_on_exec(*fd, TRUE);
        }