84 lines
2.4 KiB
Diff
84 lines
2.4 KiB
Diff
--- a/daemon/loader.c 2016-06-06 16:42:34.970216458 +0200
|
|
+++ b/daemon/loader.c 2016-06-06 16:42:42.293216836 +0200
|
|
@@ -59,13 +59,13 @@
|
|
|
|
bool terminal;
|
|
|
|
- int stdout;
|
|
+ int stdout_fd;
|
|
char stdout_buffer[CLIENT_OUTPUT_BUFFER_SIZE];
|
|
char stdout_last_line[CLIENT_OUTPUT_BUFFER_SIZE];
|
|
unsigned int stdout_last_line_repeat_count;
|
|
char * stdout_buffer_ptr;
|
|
|
|
- int stderr;
|
|
+ int stderr_fd;
|
|
char stderr_buffer[CLIENT_OUTPUT_BUFFER_SIZE];
|
|
char stderr_last_line[CLIENT_OUTPUT_BUFFER_SIZE];
|
|
unsigned int stderr_last_line_repeat_count;
|
|
@@ -149,8 +149,8 @@
|
|
|
|
if (!child_ptr->terminal)
|
|
{
|
|
- close(child_ptr->stdout);
|
|
- close(child_ptr->stderr);
|
|
+ close(child_ptr->stdout_fd);
|
|
+ close(child_ptr->stderr_fd);
|
|
}
|
|
|
|
g_on_child_exit(child_ptr->pid);
|
|
@@ -462,7 +462,7 @@
|
|
loader_read_child_output(
|
|
child_ptr->vgraph_name,
|
|
child_ptr->app_name,
|
|
- child_ptr->stdout,
|
|
+ child_ptr->stdout_fd,
|
|
false,
|
|
child_ptr->stdout_buffer,
|
|
&child_ptr->stdout_buffer_ptr,
|
|
@@ -472,7 +472,7 @@
|
|
loader_read_child_output(
|
|
child_ptr->vgraph_name,
|
|
child_ptr->app_name,
|
|
- child_ptr->stderr,
|
|
+ child_ptr->stderr_fd,
|
|
true,
|
|
child_ptr->stderr_buffer,
|
|
&child_ptr->stderr_buffer_ptr,
|
|
@@ -585,9 +585,9 @@
|
|
}
|
|
else
|
|
{
|
|
- child_ptr->stderr = stderr_pipe[0];
|
|
+ child_ptr->stderr_fd = stderr_pipe[0];
|
|
|
|
- if (fcntl(child_ptr->stderr, F_SETFL, O_NONBLOCK) == -1)
|
|
+ if (fcntl(child_ptr->stderr_fd, F_SETFL, O_NONBLOCK) == -1)
|
|
{
|
|
log_error("Failed to set nonblocking mode on "
|
|
"stderr reading end: %s",
|
|
@@ -603,7 +603,7 @@
|
|
if (!run_in_terminal)
|
|
{
|
|
/* We need pty to disable libc buffering of stdout */
|
|
- pid = forkpty(&child_ptr->stdout, NULL, NULL, NULL);
|
|
+ pid = forkpty(&child_ptr->stdout_fd, NULL, NULL, NULL);
|
|
}
|
|
else
|
|
{
|
|
@@ -650,12 +650,12 @@
|
|
/* In parent, close unused writing ends of pipe */
|
|
close(stderr_pipe[1]);
|
|
|
|
- if (fcntl(child_ptr->stdout, F_SETFL, O_NONBLOCK) == -1)
|
|
+ if (fcntl(child_ptr->stdout_fd, F_SETFL, O_NONBLOCK) == -1)
|
|
{
|
|
log_error("Could not set noblocking mode on stdout "
|
|
"- pty: %s", strerror(errno));
|
|
close(stderr_pipe[0]);
|
|
- close(child_ptr->stdout);
|
|
+ close(child_ptr->stdout_fd);
|
|
}
|
|
}
|
|
|