| 8959 | if (!rc) rc = posix_spawn_file_actions_addclose(&actions, pipefd[1]); |
| 8960 | /* A tool must not inherit or change the live terminal's input mode. */ |
| 8961 | if (!rc) rc = posix_spawn_file_actions_addopen(&actions, STDIN_FILENO, |
| 8962 | "/dev/null", O_RDONLY, 0); |
| 8963 | char *argv[] = {"sh", "-c", (char *)(cmd ? cmd : ""), NULL}; |
| 8964 | if (!rc) rc = posix_spawn(pid, "/bin/sh", &actions, &attr, argv, environ); |
| 8965 | posix_spawn_file_actions_destroy(&actions); |
| 8966 | posix_spawnattr_destroy(&attr); |
| 8967 | return rc; |
| 8968 | } |
no test coverage detected