aboutsummaryrefslogtreecommitdiff
path: root/mailutils/mail.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-09-18 03:01:49 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-09-18 03:01:49 +0200
commit34c469ae0495bb010969eb920c63d31ed4a0e793 (patch)
treef9865b5433f2fc47f2d8006a7de1ef0bb06ebe76 /mailutils/mail.c
parent0851d125c33d65cc8a0655758f2928960077c20c (diff)
downloadbusybox-34c469ae0495bb010969eb920c63d31ed4a0e793.tar.gz
sendmail: don't talk until 220 code is seen. Closes 3487
function old new delta sendmail_main 934 939 +5 smtp_checkp 167 165 -2 packed_usage 28634 28621 -13 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'mailutils/mail.c')
-rw-r--r--mailutils/mail.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mailutils/mail.c b/mailutils/mail.c
index 66c79471f..f5260d9db 100644
--- a/mailutils/mail.c
+++ b/mailutils/mail.c
@@ -57,10 +57,13 @@ void FAST_FUNC launch_helper(const char **argv)
G.helper_pid = xvfork();
i = (!G.helper_pid) * 2; // for parent:0, for child:2
- close(pipes[i + 1]); // 1 or 3 - closing one write end
- close(pipes[2 - i]); // 2 or 0 - closing one read end
- xmove_fd(pipes[i], STDIN_FILENO); // 0 or 2 - using other read end
- xmove_fd(pipes[3 - i], STDOUT_FILENO); // 3 or 1 - other write end
+ close(pipes[i + 1]); // 1 or 3 - closing one write end
+ close(pipes[2 - i]); // 2 or 0 - closing one read end
+ xmove_fd(pipes[i], STDIN_FILENO); // 0 or 2 - using other read end
+ xmove_fd(pipes[3 - i], STDOUT_FILENO); // 3 or 1 - using other write end
+ // End result:
+ // parent stdout [3] -> child stdin [2]
+ // child stdout [1] -> parent stdin [0]
if (!G.helper_pid) {
// child: try to execute connection helper