diff options
| author | Paul Eggert | 2013-07-13 17:30:45 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-13 17:30:45 -0700 |
| commit | 4700b5a52dd4dcb27c4beee2c3fda4bfd0ac0e74 (patch) | |
| tree | 03ba0299d44124ec139fce871a3b2d11590d8823 /src | |
| parent | 2ce3c56586f4061727ace4daed4582d2aa6f8e98 (diff) | |
| download | emacs-4700b5a52dd4dcb27c4beee2c3fda4bfd0ac0e74.tar.gz emacs-4700b5a52dd4dcb27c4beee2c3fda4bfd0ac0e74.zip | |
* callproc.c (child_setup, relocate_fd) [!DOS_NT]:
* process.c (create_process) [!DOS_NT]:
Remove now-unnecessary calls to emacs_close.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/callproc.c | 19 | ||||
| -rw-r--r-- | src/process.c | 1 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 101672baa1e..6ee0cacb520 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-07-14 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * callproc.c (child_setup, relocate_fd) [!DOS_NT]: | ||
| 4 | * process.c (create_process) [!DOS_NT]: | ||
| 5 | Remove now-unnecessary calls to emacs_close. | ||
| 6 | |||
| 1 | 2013-07-13 Eli Zaretskii <eliz@gnu.org> | 7 | 2013-07-13 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * w32term.c (x_draw_hollow_cursor): Delete the brush object when | 9 | * w32term.c (x_draw_hollow_cursor): Delete the brush object when |
diff --git a/src/callproc.c b/src/callproc.c index 30f9dc58d46..cdf92422b4d 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -1346,21 +1346,13 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, | |||
| 1346 | } | 1346 | } |
| 1347 | 1347 | ||
| 1348 | #ifndef MSDOS | 1348 | #ifndef MSDOS |
| 1349 | emacs_close (0); | 1349 | /* Redirect file descriptors and clear the close-on-exec flag on the |
| 1350 | emacs_close (1); | 1350 | redirected ones. IN, OUT, and ERR are close-on-exec so they |
| 1351 | emacs_close (2); | 1351 | need not be closed explicitly. */ |
| 1352 | |||
| 1353 | /* Redirect file descriptors and clear FD_CLOEXEC on the redirected ones. */ | ||
| 1354 | dup2 (in, 0); | 1352 | dup2 (in, 0); |
| 1355 | dup2 (out, 1); | 1353 | dup2 (out, 1); |
| 1356 | dup2 (err, 2); | 1354 | dup2 (err, 2); |
| 1357 | 1355 | ||
| 1358 | emacs_close (in); | ||
| 1359 | if (out != in) | ||
| 1360 | emacs_close (out); | ||
| 1361 | if (err != in && err != out) | ||
| 1362 | emacs_close (err); | ||
| 1363 | |||
| 1364 | setpgid (0, 0); | 1356 | setpgid (0, 0); |
| 1365 | tcsetpgrp (0, pid); | 1357 | tcsetpgrp (0, pid); |
| 1366 | 1358 | ||
| @@ -1386,7 +1378,8 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, | |||
| 1386 | 1378 | ||
| 1387 | #ifndef WINDOWSNT | 1379 | #ifndef WINDOWSNT |
| 1388 | /* Move the file descriptor FD so that its number is not less than MINFD. | 1380 | /* Move the file descriptor FD so that its number is not less than MINFD. |
| 1389 | If the file descriptor is moved at all, the original is freed. */ | 1381 | If the file descriptor is moved at all, the original is closed on MSDOS, |
| 1382 | but not elsewhere as the caller will close it anyway. */ | ||
| 1390 | static int | 1383 | static int |
| 1391 | relocate_fd (int fd, int minfd) | 1384 | relocate_fd (int fd, int minfd) |
| 1392 | { | 1385 | { |
| @@ -1400,7 +1393,9 @@ relocate_fd (int fd, int minfd) | |||
| 1400 | emacs_perror ("while setting up child"); | 1393 | emacs_perror ("while setting up child"); |
| 1401 | _exit (EXIT_CANCELED); | 1394 | _exit (EXIT_CANCELED); |
| 1402 | } | 1395 | } |
| 1396 | #ifdef MSDOS | ||
| 1403 | emacs_close (fd); | 1397 | emacs_close (fd); |
| 1398 | #endif | ||
| 1404 | return new; | 1399 | return new; |
| 1405 | } | 1400 | } |
| 1406 | } | 1401 | } |
diff --git a/src/process.c b/src/process.c index 4a38c47443a..8589acaa8b5 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1831,7 +1831,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1831 | pid = child_setup (xforkin, xforkout, xforkout, | 1831 | pid = child_setup (xforkin, xforkout, xforkout, |
| 1832 | new_argv, 1, encoded_current_dir); | 1832 | new_argv, 1, encoded_current_dir); |
| 1833 | #else /* not WINDOWSNT */ | 1833 | #else /* not WINDOWSNT */ |
| 1834 | emacs_close (wait_child_setup[0]); | ||
| 1835 | child_setup (xforkin, xforkout, xforkout, | 1834 | child_setup (xforkin, xforkout, xforkout, |
| 1836 | new_argv, 1, encoded_current_dir); | 1835 | new_argv, 1, encoded_current_dir); |
| 1837 | #endif /* not WINDOWSNT */ | 1836 | #endif /* not WINDOWSNT */ |