| 1060 | /* Move OLDFD to NEWFD. If OLDFD != NEWFD, NEWFD is not close-on-exec. */ |
| 1061 | |
| 1062 | static void |
| 1063 | move_fd (int oldfd, int newfd) |
| 1064 | { |
| 1065 | if (oldfd != newfd) |
| 1066 | { |
| 1067 | /* These should never fail for our usage. */ |
| 1068 | ignore_value (dup2 (oldfd, newfd)); |
| 1069 | ignore_value (close (oldfd)); |
| 1070 | } |
| 1071 | } |
| 1072 | |
| 1073 | /* Setup ACTION to move OLDFD to NEWFD. If OLDFD != NEWFD, NEWFD is not |
| 1074 | close-on-exec. Returns 0 if successful, or an error number otherwise. */ |