summaryrefslogtreecommitdiff
path: root/x11/gnome-terminal/files/extra-src_terminal-screen.c
blob: 3ea47ebc9a1d251807288b707b8ab721346accbb (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
--- src/terminal-screen.c.orig	2014-09-23 20:15:23.000000000 +0200
+++ src/terminal-screen.c	2014-11-09 20:19:35.759291981 +0100
@@ -1192,7 +1192,21 @@
       for (j = 0; j < n_fds; j++) {
         if (fds[j] == target_fd) {
           do {
+#if defined(F_DUPFD_CLOEXEC)
             fd = fcntl (fds[j], F_DUPFD_CLOEXEC, 3);
+#else
+            fd = fcntl (fds[j], F_DUPFD, 3);
+            int flags = fcntl (fd, F_GETFD);
+            if (flags ==  -1)
+            {
+              //errror
+            }
+            flags |= FD_CLOEXEC;
+            if (fcntl (fd, F_SETFD, FD_CLOEXEC) == -1)
+            {
+              //error
+            }
+#endif
           } while (fd == -1 && errno == EINTR);
           if (fd == -1)
             _exit (127);