patch-main_c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --- xterm-297.orig/main.c 2013-05-28 00:11:11.000000000 +0200
  2. +++ xterm-297/main.c 2013-10-31 12:24:52.000000000 +0100
  3. @@ -2583,7 +2583,7 @@ main(int argc, char *argv[]ENVP_ARG)
  4. }
  5. }
  6. -#if defined(__osf__) || (defined(__GLIBC__) && !defined(USE_USG_PTYS)) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
  7. +#if defined(__osf__) || (defined(__linux__) && !defined(USE_USG_PTYS)) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
  8. #define USE_OPENPTY 1
  9. static int opened_tty = -1;
  10. #endif
  11. @@ -3134,7 +3134,7 @@ find_utmp(struct UTMP_STR *tofind)
  12. #define close_fd(fd) close(fd), fd = -1
  13. -#if defined(TIOCNOTTY) && (!defined(__GLIBC__) || (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
  14. +#if defined(TIOCNOTTY) && defined(__linux__)
  15. #define USE_NO_DEV_TTY 1
  16. #else
  17. #define USE_NO_DEV_TTY 0
  18. @@ -3378,7 +3378,8 @@ spawnXTerm(XtermWidget xw)
  19. }
  20. #endif /* __MVS__ */
  21. - close_fd(ttyfd);
  22. + // do not close it here
  23. + // close_fd(ttyfd);
  24. }
  25. if (get_pty(&screen->respond, XDisplayString(screen->display))) {
  26. @@ -3807,8 +3808,9 @@ spawnXTerm(XtermWidget xw)
  27. eg. by lineedit in the shell, or emacs, etc. then tio
  28. will have bad values. Let's just get termio from the
  29. new tty and tailor it. */
  30. - if (ttyGetAttr(ttyfd, &tio) == -1)
  31. + if (ttyGetAttr(ttyfd, &tio) == -1) {
  32. SysError(ERROR_TIOCGETP);
  33. + }
  34. tio.c_lflag |= ECHOE;
  35. #endif /* umips */
  36. /* Now is also the time to change the modes of the