aboutsummaryrefslogtreecommitdiff
path: root/miscutils/timeout.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/timeout.c')
-rw-r--r--miscutils/timeout.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/miscutils/timeout.c b/miscutils/timeout.c
index 83ae56e69..48b8d8fc0 100644
--- a/miscutils/timeout.c
+++ b/miscutils/timeout.c
@@ -71,9 +71,7 @@ int timeout_main(int argc UNUSED_PARAM, char **argv)
71 sv1 = argv[optind]; 71 sv1 = argv[optind];
72 sv2 = argv[optind + 1]; 72 sv2 = argv[optind + 1];
73#endif 73#endif
74 pid = vfork(); 74 pid = xvfork();
75 if (pid < 0)
76 bb_perror_msg_and_die("vfork");
77 if (pid == 0) { 75 if (pid == 0) {
78 /* Child: spawn grandchild and exit */ 76 /* Child: spawn grandchild and exit */
79 parent = getppid(); 77 parent = getppid();
@@ -110,6 +108,5 @@ int timeout_main(int argc UNUSED_PARAM, char **argv)
110 argv[0] = sv1; 108 argv[0] = sv1;
111 argv[1] = sv2; 109 argv[1] = sv2;
112#endif 110#endif
113 BB_EXECVP(argv[0], argv); 111 BB_EXECVP_or_die(argv);
114 bb_perror_msg_and_die("exec '%s'", argv[0]);
115} 112}