rework patch a bit based on feedback from upstream

This commit is contained in:
jasper 2013-04-08 07:57:03 +00:00
parent 3372cf0217
commit c07ebe8f0f
2 changed files with 15 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.96 2013/04/06 09:45:12 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.97 2013/04/08 07:57:03 jasper Exp $
SHARED_ONLY= Yes
@ -6,7 +6,7 @@ COMMENT= GNOME terminal
GNOME_PROJECT= gnome-terminal
GNOME_VERSION= 3.8.0
REVISION= 5
REVISION= 6
# GPLv3+
PERMIT_PACKAGE_CDROM= Yes

View File

@ -1,20 +1,25 @@
$OpenBSD: patch-src_terminal-screen_c,v 1.6 2013/04/01 09:18:52 jasper Exp $
$OpenBSD: patch-src_terminal-screen_c,v 1.7 2013/04/08 07:57:03 jasper Exp $
From 628162f198ffb60dd5c8c30c152af9761f9568b2 Mon Sep 17 00:00:00 2001
From a8c7f7928f0415d9efc79074d52b534bd253360d Mon Sep 17 00:00:00 2001
From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
Date: Mon, 1 Apr 2013 11:13:05 +0200
Subject: Use dup2() (POSIX) instead of dup3() (GLIBC) as the former suffices.
Date: Mon, 8 Apr 2013 09:50:38 +0200
Subject: [PATCH] Only use dup3 on linux as it's a GLIBC extension.
https://bugzilla.gnome.org/show_bug.cgi?id=697024
--- src/terminal-screen.c.orig Wed Mar 20 11:09:31 2013
+++ src/terminal-screen.c Fri Mar 29 18:22:25 2013
@@ -1347,7 +1347,7 @@ terminal_screen_child_setup (FDSetupData *data)
+++ src/terminal-screen.c Mon Apr 8 09:44:32 2013
@@ -1347,7 +1347,13 @@ terminal_screen_child_setup (FDSetupData *data)
/* Now we know that target_fd can be safely overwritten. */
errno = 0;
do {
- fd = dup3 (fds[idx], target_fd, 0 /* no FD_CLOEXEC */);
+ fd = dup2 (fds[idx], target_fd /* no FD_CLOEXEC */);
+#ifdef __linux
fd = dup3 (fds[idx], target_fd, 0 /* no FD_CLOEXEC */);
+#else
+ fd = fcntl(fds[idx], F_DUPFD, target_fd);
+ if (fd & FD_CLOEXEC)
+ _exit (127);
+#endif
} while (fd == -1 && errno == EINTR);
if (fd != target_fd)
_exit (127);