MCPcopy Index your code
hub / github.com/RsyncProject/rsync / shell_exec

Function shell_exec

main.c:172–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172int shell_exec(const char *cmd)
173{
174 char *shell = getenv("RSYNC_SHELL");
175 int status;
176 pid_t pid;
177
178 if (!shell)
179 return system(cmd);
180
181 if ((pid = fork()) < 0)
182 return -1;
183
184 if (pid == 0) {
185 execlp(shell, shell, "-c", cmd, NULL);
186 _exit(1);
187 }
188
189 int ret = wait_process(pid, &status, 0);
190 return ret < 0 ? -1 : status;
191}
192
193/* Wait for a process to exit, calling io_flush while waiting. */
194static void wait_process_with_flush(pid_t pid, int *exit_code_ptr)

Callers 4

sock_execFunction · 0.85
rsync_panic_handlerFunction · 0.85
start_pre_execFunction · 0.85
rsync_moduleFunction · 0.85

Calls 1

wait_processFunction · 0.85

Tested by

no test coverage detected