summaryrefslogtreecommitdiff
path: root/package/xterm/patches/patch-main_c
blob: dbe55d4edd0b65b9e624b01817a5373ae252f294 (plain)
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
--- xterm-297.orig/main.c	2013-05-28 00:11:11.000000000 +0200
+++ xterm-297/main.c	2013-10-31 12:24:52.000000000 +0100
@@ -2583,7 +2583,7 @@ main(int argc, char *argv[]ENVP_ARG)
     }
 }
 
-#if defined(__osf__) || (defined(__GLIBC__) && !defined(USE_USG_PTYS)) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__osf__) || (defined(__linux__) && !defined(USE_USG_PTYS)) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
 #define USE_OPENPTY 1
 static int opened_tty = -1;
 #endif
@@ -3134,7 +3134,7 @@ find_utmp(struct UTMP_STR *tofind)
 
 #define close_fd(fd) close(fd), fd = -1
 
-#if defined(TIOCNOTTY) && (!defined(__GLIBC__) || (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
+#if defined(TIOCNOTTY) && defined(__linux__)
 #define USE_NO_DEV_TTY 1
 #else
 #define USE_NO_DEV_TTY 0
@@ -3378,7 +3378,8 @@ spawnXTerm(XtermWidget xw)
 	    }
 #endif /* __MVS__ */
 
-	    close_fd(ttyfd);
+	    // do not close it here
+	    // close_fd(ttyfd);
 	}
 
 	if (get_pty(&screen->respond, XDisplayString(screen->display))) {
@@ -3807,8 +3808,9 @@ spawnXTerm(XtermWidget xw)
 		   eg. by lineedit in the shell, or emacs, etc. then tio
 		   will have bad values.  Let's just get termio from the
 		   new tty and tailor it.  */
-		if (ttyGetAttr(ttyfd, &tio) == -1)
+		if (ttyGetAttr(ttyfd, &tio) == -1) {
 		    SysError(ERROR_TIOCGETP);
+		}
 		tio.c_lflag |= ECHOE;
 #endif /* umips */
 		/* Now is also the time to change the modes of the