aboutsummaryrefslogtreecommitdiff
path: root/srcpkgs/ladish/patches/musl-stdout.patch
blob: 6a881fc20a076b44ae40b9ca1c2016731e17cfdb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
--- 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);
     }
   }