git_fixes.diff 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. From 473959141641b6779e6ff3c3c5b6ef326073bcd4 Mon Sep 17 00:00:00 2001
  2. From: Mike FABIAN <mfabian@redhat.com>
  3. Date: Tue, 07 Jun 2011 11:42:00 +0000
  4. Subject: Set up terminal before fork.
  5. After the fork it is undefined wether parent or child runs
  6. first. So there can be a race: if the child runs before the
  7. terminal of the parent is set up correctly luit may hang.
  8. This patch sets up the terminal before forking and undoes
  9. the settings in the child.
  10. Signed-off-by: Mike FABIAN <mfabian@redhat.com>
  11. Signed-off-by: Egbert Eich <eich@freedesktop.org>
  12. ---
  13. diff --git a/luit.c b/luit.c
  14. index 0ece7b6..5cb3b8f 100644
  15. --- a/luit.c
  16. +++ b/luit.c
  17. @@ -577,6 +577,8 @@ condom(int argc, char **argv)
  18. IGNORE_RC(pipe(c2p_waitpipe));
  19. }
  20. + setup_io(pty);
  21. +
  22. pid = fork();
  23. if (pid < 0) {
  24. perror("Couldn't fork");
  25. @@ -584,6 +586,10 @@ condom(int argc, char **argv)
  26. }
  27. if (pid == 0) {
  28. +#ifdef SIGWINCH
  29. + installHandler(SIGWINCH, SIG_DFL);
  30. +#endif
  31. + installHandler(SIGCHLD, SIG_DFL);
  32. close(pty);
  33. if (pipe_option) {
  34. close_waitpipe(1);
  35. @@ -661,7 +667,6 @@ parent(int pid GCC_UNUSED, int pty)
  36. if (verbose) {
  37. reportIso2022(outputState);
  38. }
  39. - setup_io(pty);
  40. if (pipe_option) {
  41. write_waitpipe(p2c_waitpipe);
  42. --
  43. cgit v0.9.0.2-2-gbebe
  44. From 09f4907e4ab4ba3654de829bf3ac2a4a02bb9ef4 Mon Sep 17 00:00:00 2001
  45. From: Alan Coopersmith <alan.coopersmith@oracle.com>
  46. Date: Sat, 22 Jun 2013 04:11:43 +0000
  47. Subject: Fix GCC_UNUSED definition to actually work with -Wunused-parameter
  48. Silences warnings of:
  49. charset.c: In function ‘IdentityRecode’:
  50. charset.c:42:51: warning: unused parameter ‘self’ [-Wunused-parameter]
  51. charset.c: In function ‘NullReverse’:
  52. charset.c:84:26: warning: unused parameter ‘n’ [-Wunused-parameter]
  53. charset.c:84:59: warning: unused parameter ‘self’ [-Wunused-parameter]
  54. other.c: In function ‘mapping_utf8’:
  55. other.c:108:44: warning: unused parameter ‘s’ [-Wunused-parameter]
  56. other.c: In function ‘reverse_utf8’:
  57. other.c:114:44: warning: unused parameter ‘s’ [-Wunused-parameter]
  58. luit.c: In function ‘sigwinchHandler’:
  59. luit.c:463:21: warning: unused parameter ‘sig’ [-Wunused-parameter]
  60. luit.c: In function ‘sigchldHandler’:
  61. luit.c:470:20: warning: unused parameter ‘sig’ [-Wunused-parameter]
  62. luit.c: In function ‘parent’:
  63. luit.c:657:12: warning: unused parameter ‘pid’ [-Wunused-parameter]
  64. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
  65. ---
  66. diff --git a/other.h b/other.h
  67. index 9d814a3..d18b586 100644
  68. --- a/other.h
  69. +++ b/other.h
  70. @@ -26,7 +26,11 @@ THE SOFTWARE.
  71. #include "config.h" /* include this, for self-contained headers */
  72. #ifndef GCC_UNUSED
  73. -#define GCC_UNUSED /* ARGSUSED */
  74. +# if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
  75. +# define GCC_UNUSED __attribute__((__unused__))
  76. +# else
  77. +# define GCC_UNUSED /* ARGSUSED */
  78. +# endif
  79. #endif
  80. #include <X11/fonts/fontenc.h>
  81. --
  82. cgit v0.9.0.2-2-gbebe
  83. From 445863f8b5059692ac7a4df785af6920849faa82 Mon Sep 17 00:00:00 2001
  84. From: Alan Coopersmith <alan.coopersmith@oracle.com>
  85. Date: Sat, 13 Jul 2013 16:08:34 +0000
  86. Subject: config: Add missing AC_CONFIG_SRCDIR
  87. Regroup AC statements under the Autoconf initialization section.
  88. Regroup AM statements under the Automake initialization section.
  89. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
  90. Reviewed-by: Julien Cristau <jcristau@debian.org>
  91. Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
  92. ---
  93. diff --git a/configure.ac b/configure.ac
  94. index c214d85..946db23 100644
  95. --- a/configure.ac
  96. +++ b/configure.ac
  97. @@ -20,9 +20,14 @@ dnl PERFORMANCE OF THIS SOFTWARE.
  98. dnl
  99. dnl Process this file with autoconf to create configure.
  100. +# Initialize Autoconf
  101. AC_PREREQ([2.60])
  102. AC_INIT([luit], [1.1.1],
  103. [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [luit])
  104. +AC_CONFIG_SRCDIR([Makefile.am])
  105. +AC_CONFIG_HEADERS([config.h])
  106. +
  107. +# Initialize Automake
  108. AM_INIT_AUTOMAKE([foreign dist-bzip2])
  109. AM_MAINTAINER_MODE
  110. @@ -32,8 +37,6 @@ m4_ifndef([XORG_MACROS_VERSION],
  111. XORG_MACROS_VERSION(1.8)
  112. XORG_DEFAULT_OPTIONS
  113. -AC_CONFIG_HEADERS([config.h])
  114. -
  115. AC_CANONICAL_HOST
  116. --
  117. cgit v0.9.0.2-2-gbebe
  118. From 800f55f8dcd195dd0cdfc1c4d7487d00bb7745f4 Mon Sep 17 00:00:00 2001
  119. From: Alan Coopersmith <alan.coopersmith@oracle.com>
  120. Date: Sat, 13 Jul 2013 16:11:20 +0000
  121. Subject: Replace hardcoded _XOPEN_SOURCE=500 with AC_USE_SYSTEM_EXTENSIONS
  122. -D_XOPEN_SOURCE was originally added for Linux in commit e751086392e837
  123. and then updated to -D_XOPEN_SOURCE=500 in commit e1a002217cabdb to
  124. expose strdup() in glibc headers.
  125. As noted in bug 47792 though, the posix_openpt() function is not
  126. visible unless that's raised to 600.
  127. Instead of continually chasing the standards ourselves, switch to letting
  128. autoconf handle that for us.
  129. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
  130. Reviewed-by: Julien Cristau <jcristau@debian.org>
  131. Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
  132. ---
  133. diff --git a/Makefile.am b/Makefile.am
  134. index 8069670..ef042e3 100644
  135. --- a/Makefile.am
  136. +++ b/Makefile.am
  137. @@ -25,7 +25,6 @@ bin_PROGRAMS = luit
  138. AM_CFLAGS = \
  139. $(CWARNFLAGS) \
  140. $(LUIT_CFLAGS) \
  141. - $(OS_CFLAGS) \
  142. -DLOCALE_ALIAS_FILE=\"$(LOCALEALIASFILE)\"
  143. luit_LDADD = $(LUIT_LIBS)
  144. diff --git a/configure.ac b/configure.ac
  145. index 946db23..0ec4664 100644
  146. --- a/configure.ac
  147. +++ b/configure.ac
  148. @@ -26,6 +26,7 @@ AC_INIT([luit], [1.1.1],
  149. [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [luit])
  150. AC_CONFIG_SRCDIR([Makefile.am])
  151. AC_CONFIG_HEADERS([config.h])
  152. +AC_USE_SYSTEM_EXTENSIONS
  153. # Initialize Automake
  154. AM_INIT_AUTOMAKE([foreign dist-bzip2])
  155. @@ -37,9 +38,6 @@ m4_ifndef([XORG_MACROS_VERSION],
  156. XORG_MACROS_VERSION(1.8)
  157. XORG_DEFAULT_OPTIONS
  158. -AC_CANONICAL_HOST
  159. -
  160. -
  161. AC_CHECK_HEADERS([pty.h stropts.h sys/param.h sys/select.h])
  162. AC_CHECK_FUNCS([select grantpt posix_openpt])
  163. @@ -57,23 +55,16 @@ PKG_CHECK_MODULES(LUIT, fontenc)
  164. PKG_CHECK_EXISTS(x11, [],
  165. [AC_MSG_WARN([libX11 not found. luit may not be able to find locale aliases without it.])])
  166. +AC_CANONICAL_HOST
  167. case $host_os in
  168. # darwin has poll() but can't be used to poll character devices (atleast through SnowLeopard)
  169. darwin*)
  170. - OS_CFLAGS=
  171. - ;;
  172. - linux*)
  173. - AC_CHECK_HEADERS([poll.h])
  174. - AC_CHECK_FUNCS([poll])
  175. - OS_CFLAGS="-D_XOPEN_SOURCE=500"
  176. ;;
  177. *)
  178. AC_CHECK_HEADERS([poll.h])
  179. AC_CHECK_FUNCS([poll])
  180. - OS_CFLAGS=
  181. ;;
  182. esac
  183. -AC_SUBST(OS_CFLAGS)
  184. AC_CHECK_HEADERS([pty.h stropts.h sys/ioctl.h sys/param.h sys/poll.h sys/select.h sys/time.h termios.h])
  185. AC_CHECK_FUNCS([grantpt putenv select strdup])
  186. --
  187. cgit v0.9.0.2-2-gbebe
  188. From e1f495359a74342352c4d6641c0002c7c79327ba Mon Sep 17 00:00:00 2001
  189. From: Alan Coopersmith <alan.coopersmith@oracle.com>
  190. Date: Sat, 13 Jul 2013 16:15:16 +0000
  191. Subject: Merge overlapping AC_CHECK_HEADERS & AC_CHECK_FUNCS calls into one set
  192. Duplication introduced when merging in changes in commit fddfe30c3ff91c
  193. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
  194. Reviewed-by: Julien Cristau <jcristau@debian.org>
  195. Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
  196. ---
  197. diff --git a/configure.ac b/configure.ac
  198. index 0ec4664..1c6f2c9 100644
  199. --- a/configure.ac
  200. +++ b/configure.ac
  201. @@ -38,9 +38,6 @@ m4_ifndef([XORG_MACROS_VERSION],
  202. XORG_MACROS_VERSION(1.8)
  203. XORG_DEFAULT_OPTIONS
  204. -AC_CHECK_HEADERS([pty.h stropts.h sys/param.h sys/select.h])
  205. -AC_CHECK_FUNCS([select grantpt posix_openpt])
  206. -
  207. AC_ARG_WITH(localealiasfile,
  208. AS_HELP_STRING([--with-localealiasfile=<path>],
  209. [The locale alias file (default: ${datadir}/X11/locale/locale.alias)]),
  210. @@ -67,7 +64,7 @@ case $host_os in
  211. esac
  212. AC_CHECK_HEADERS([pty.h stropts.h sys/ioctl.h sys/param.h sys/poll.h sys/select.h sys/time.h termios.h])
  213. -AC_CHECK_FUNCS([grantpt putenv select strdup])
  214. +AC_CHECK_FUNCS([grantpt posix_openpt putenv select strdup])
  215. if test "x$ac_cv_func_grantpt" != "xyes" ; then
  216. AC_CHECK_LIB(util, openpty, [cf_have_openpty=yes],[cf_have_openpty=no])
  217. --
  218. cgit v0.9.0.2-2-gbebe