[gnome-terminal] screen: Portability fix



commit b7df4813c7b85377309f8b9aecd6cae37af3cb0a
Author: Christian Persch <chpe gnome org>
Date:   Mon Apr 8 14:04:16 2013 +0200

    screen: Portability fix
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697024

 src/terminal-screen.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index a0b46ed..c9044b3 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -16,7 +16,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <config.h>
+#include "config.h"
 #define _GNU_SOURCE /* for dup3 */
 
 #include "terminal-screen.h"
@@ -189,6 +189,22 @@ static GRegex **url_regexes;
 static TerminalURLFlavour *url_regex_flavors;
 static guint n_url_regexes;
 
+/* See bug #697024 */
+#ifndef __linux__
+
+#undef dup3
+#define dup3 fake_dup3
+
+static int
+fake_dup3 (int fd, int fd2, int flags)
+{
+  if (dup2 (fd, fd2) == -1)
+    return -1;
+
+  return fcntl (fd2, F_SETFD, flags);
+}
+#endif /* !__linux__ */
+
 G_DEFINE_TYPE (TerminalScreen, terminal_screen, VTE_TYPE_TERMINAL)
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]