summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d013a58)
We have to wait for children to terminate because otherwise the
client commands may be executed in random order.
Since no caller checked the return value of client_cmd(), make it
abort on errors and change the return value to void.
Also, each caller only passed one string, so make it take only a
char * pointer.
-static int client_cmd(const char *cmd,...)
+static void client_cmd(const char *cmd)
{
int ret, fds[3] = {0, 0, 0};
pid_t pid;
{
int ret, fds[3] = {0, 0, 0};
pid_t pid;
PARA_INFO_LOG("%s\n", cmdline);
ret = para_exec_cmdline_pid(&pid, cmdline, fds);
free(cmdline);
PARA_INFO_LOG("%s\n", cmdline);
ret = para_exec_cmdline_pid(&pid, cmdline, fds);
free(cmdline);
+ if (ret < 0)
+ exit(EXIT_FAILURE);
+ do
+ ret = wait(NULL);
+ while (ret != -1 && errno != ECHILD);
}
static void change_afs_mode_and_play(char *afs_mode)
}
static void change_afs_mode_and_play(char *afs_mode)