hush: fix var_bash3.tests failure
[oweals/busybox.git] / mailutils / mail.c
index 64a5b996f4f831517bf860380246760740707fe8..8e52a3efc319ae428cd282662ba76468d57dde1d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com>
  *
- * Licensed under GPLv2, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2, see file LICENSE in this source tree.
  */
 #include "libbb.h"
 #include "mail.h"
@@ -54,9 +54,7 @@ void FAST_FUNC launch_helper(const char **argv)
                + (1 << SIGALRM)
                , signal_handler);
 
-       G.helper_pid = vfork();
-       if (G.helper_pid < 0)
-               bb_perror_msg_and_die("vfork");
+       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
@@ -67,8 +65,7 @@ void FAST_FUNC launch_helper(const char **argv)
        if (!G.helper_pid) {
                // child: try to execute connection helper
                // NB: SIGCHLD & SIGALRM revert to SIG_DFL on exec
-               BB_EXECVP(*argv, (char **)argv);
-               _exit(127);
+               BB_EXECVP_or_die((char**)argv);
        }
 
        // parent