]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
cleanup
authorTimo Sirainen <tss@iki.fi>
Sat, 19 Jun 2004 21:29:39 +0000 (00:29 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 19 Jun 2004 21:29:39 +0000 (00:29 +0300)
--HG--
branch : HEAD

src/master/mail-process.c

index 75ee0c7921dc37b2d4eddb55311c94dff054c1c0..1319f3eac309e27fffa536ccb71c7fe41445ad91 100644 (file)
@@ -252,8 +252,7 @@ int create_mail_process(struct login_group *group, int socket,
 
        child_process_init_env();
 
-       /* move the client socket into stdin and stdout fds */
-       fd_close_on_exec(socket, FALSE);
+       /* move the client socket into stdin and stdout fds, log to stderr */
        if (dup2(socket, 0) < 0)
                i_fatal("dup2(stdin) failed: %m");
        if (dup2(socket, 1) < 0)
@@ -261,8 +260,8 @@ int create_mail_process(struct login_group *group, int socket,
        if (dup2(log_fd, 2) < 0)
                i_fatal("dup2(stderr) failed: %m");
 
-       if (close(socket) < 0)
-               i_error("close(mail client) failed: %m");
+       for (i = 0; i < 3; i++)
+               fd_close_on_exec(i, FALSE);
 
        /* setup environment - set the most important environment first
           (paranoia about filling up environment without noticing) */