← Commit list

cd48f0711

Denys Vlasenko
Denys Vlasenko
2020-12-17
SUCCESS Duration: 152s

Subject

mail: launch_helper(): flush stdio before vfork, set G.helper_pid only in parent

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

mailutils/mail.c+3 -1
@@ -46,7 +46,8 @@ void FAST_FUNC launch_helper(const char **argv)
+ (1 << SIGALRM)
, signal_handler);
- G.helper_pid = pid = xvfork();
+ fflush_all();
+ pid = xvfork();
if (pid == 0) {
// child
close(child_in.wr);
@@ -59,6 +60,7 @@ void FAST_FUNC launch_helper(const char **argv)
// NB: SIGCHLD & SIGALRM revert to SIG_DFL on exec
BB_EXECVP_or_die((char**)argv);
}
+ G.helper_pid = pid;
close(child_out.wr);
close(child_in.rd);
xmove_fd(child_out.rd, STDIN_FILENO);