um: Do not use stdin and stdout identifiers for struct members
stdin, stdout and stderr are macros according to C89/C99. Thus do not use them as struct member identifiers to avoid bad results from macro expansion. Signed-off-by: Hans-Werner Hilse <hwhilse@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:

committed by
Richard Weinberger

parent
9a75551aea
commit
f9bb3b5947
@@ -166,7 +166,7 @@ int net_sendto(int fd, void *buf, int len, void *to, int sock_len)
|
||||
|
||||
struct change_pre_exec_data {
|
||||
int close_me;
|
||||
int stdout;
|
||||
int stdout_fd;
|
||||
};
|
||||
|
||||
static void change_pre_exec(void *arg)
|
||||
@@ -174,7 +174,7 @@ static void change_pre_exec(void *arg)
|
||||
struct change_pre_exec_data *data = arg;
|
||||
|
||||
close(data->close_me);
|
||||
dup2(data->stdout, 1);
|
||||
dup2(data->stdout_fd, 1);
|
||||
}
|
||||
|
||||
static int change_tramp(char **argv, char *output, int output_len)
|
||||
@@ -189,7 +189,7 @@ static int change_tramp(char **argv, char *output, int output_len)
|
||||
return err;
|
||||
}
|
||||
pe_data.close_me = fds[0];
|
||||
pe_data.stdout = fds[1];
|
||||
pe_data.stdout_fd = fds[1];
|
||||
pid = run_helper(change_pre_exec, &pe_data, argv);
|
||||
|
||||
if (pid > 0) /* Avoid hang as we won't get data in failure case. */
|
||||
|
Reference in New Issue
Block a user