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:
Hans-Werner Hilse
2015-06-11 11:29:19 +02:00
committed by Richard Weinberger
parent 9a75551aea
commit f9bb3b5947
5 changed files with 30 additions and 30 deletions

View File

@@ -9,8 +9,8 @@
#include <os.h>
struct dog_data {
int stdin;
int stdout;
int stdin_fd;
int stdout_fd;
int close_me[2];
};
@@ -18,11 +18,11 @@ static void pre_exec(void *d)
{
struct dog_data *data = d;
dup2(data->stdin, 0);
dup2(data->stdout, 1);
dup2(data->stdout, 2);
close(data->stdin);
close(data->stdout);
dup2(data->stdin_fd, 0);
dup2(data->stdout_fd, 1);
dup2(data->stdout_fd, 2);
close(data->stdin_fd);
close(data->stdout_fd);
close(data->close_me[0]);
close(data->close_me[1]);
}
@@ -49,8 +49,8 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
goto out_close_in;
}
data.stdin = out_fds[0];
data.stdout = in_fds[1];
data.stdin_fd = out_fds[0];
data.stdout_fd = in_fds[1];
data.close_me[0] = out_fds[1];
data.close_me[1] = in_fds[0];