diff options
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/callproc.c b/src/callproc.c index 369d6eda909..fc274f3d9c0 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -1221,7 +1221,7 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, | |||
| 1221 | are changed between the check and this chdir, but we should | 1221 | are changed between the check and this chdir, but we should |
| 1222 | at least check. */ | 1222 | at least check. */ |
| 1223 | if (chdir (temp) < 0) | 1223 | if (chdir (temp) < 0) |
| 1224 | _exit (errno); | 1224 | _exit (EXIT_CANCELED); |
| 1225 | #else /* DOS_NT */ | 1225 | #else /* DOS_NT */ |
| 1226 | /* Get past the drive letter, so that d:/ is left alone. */ | 1226 | /* Get past the drive letter, so that d:/ is left alone. */ |
| 1227 | if (i > 2 && IS_DEVICE_SEP (temp[1]) && IS_DIRECTORY_SEP (temp[2])) | 1227 | if (i > 2 && IS_DEVICE_SEP (temp[1]) && IS_DIRECTORY_SEP (temp[2])) |
| @@ -1366,10 +1366,12 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, | |||
| 1366 | 1366 | ||
| 1367 | execve (new_argv[0], new_argv, env); | 1367 | execve (new_argv[0], new_argv, env); |
| 1368 | 1368 | ||
| 1369 | emacs_write (1, "Can't exec program: ", 20); | 1369 | /* Don't output the program name here, as it can be arbitrarily long, |
| 1370 | emacs_write (1, new_argv[0], strlen (new_argv[0])); | 1370 | and a long write from a vforked child to its parent can cause a |
| 1371 | emacs_write (1, "\n", 1); | 1371 | deadlock. */ |
| 1372 | _exit (1); | 1372 | emacs_perror ("child process"); |
| 1373 | |||
| 1374 | _exit (errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE); | ||
| 1373 | 1375 | ||
| 1374 | #else /* MSDOS */ | 1376 | #else /* MSDOS */ |
| 1375 | pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env); | 1377 | pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env); |
| @@ -1395,13 +1397,8 @@ relocate_fd (int fd, int minfd) | |||
| 1395 | int new = fcntl (fd, F_DUPFD_CLOEXEC, minfd); | 1397 | int new = fcntl (fd, F_DUPFD_CLOEXEC, minfd); |
| 1396 | if (new == -1) | 1398 | if (new == -1) |
| 1397 | { | 1399 | { |
| 1398 | const char *message_1 = "Error while setting up child: "; | 1400 | emacs_perror ("while setting up child"); |
| 1399 | const char *errmessage = strerror (errno); | 1401 | _exit (EXIT_CANCELED); |
| 1400 | const char *message_2 = "\n"; | ||
| 1401 | emacs_write (2, message_1, strlen (message_1)); | ||
| 1402 | emacs_write (2, errmessage, strlen (errmessage)); | ||
| 1403 | emacs_write (2, message_2, strlen (message_2)); | ||
| 1404 | _exit (1); | ||
| 1405 | } | 1402 | } |
| 1406 | emacs_close (fd); | 1403 | emacs_close (fd); |
| 1407 | return new; | 1404 | return new; |