zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] fix portability bug in
@ 2004-10-22 12:09 Borzenkov Andrey
  2004-10-22 12:52 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Borzenkov Andrey @ 2004-10-22 12:09 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

Hi, long time have not been here :)

The patch from 20025 does not allow configure to run here because

- here /bin/sh (or /bin/ksh, does not matter) do not have SIGTTOU but just
TTOU so 'trap "" SIGTTOU' is an error

- according to SUS (Shell Command Language, 2.8.1) trap is special builtin
so non-zero exit code makes scripting shell immediately exit; the "trap ||
:" does not help.

The patch attempts to "fix" while still leaving trap in place. I do not know
why it is needed so I did not add "trap TTOU" (for my system :) In general
this looks rather inherently non-portable so the best way would be to get
rid of this trap at all (default for SIGTTOU is ignore anyway).

Please check if it still works for original problem.

Regards

-andrey



[-- Attachment #2: configure.ac.diff --]
[-- Type: application/octet-stream, Size: 975 bytes --]

Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.21
diff -u -r1.21 configure.ac
--- configure.ac	8 Oct 2004 14:36:54 -0000	1.21
+++ configure.ac	22 Oct 2004 11:40:54 -0000
@@ -1804,7 +1804,7 @@
 if test "x$ac_cv_func_tcsetpgrp" = xyes; then
 case "x$zsh_working_tcsetpgrp" in
   xcheck)
-    trap "" SIGTTOU > /dev/null 2>&1 || :
+    ( trap "" SIGTTOU > /dev/null 2>&1 ) && trap "" SIGTTOU > /dev/null 2>&1 
     AC_CACHE_CHECK(if tcsetpgrp() actually works,
     zsh_cv_sys_tcsetpgrp,
     [AC_TRY_RUN([
@@ -1835,7 +1835,7 @@
 Try running configure with --with-tcsetpgrp or --without-tcsetpgrp]);;
       *)      AC_MSG_ERROR([unexpected return status]);;
     esac
-    trap - SIGTTOU > /dev/null 2>&1 || :
+    ( trap - SIGTTOU > /dev/null 2>&1 ) && trap - SIGTTOU > /dev/null 2>&1 
     ;;
   xyes) :;;
   xno)  AC_DEFINE(BROKEN_TCSETPGRP);;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-22 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-22 12:09 [PATCH] fix portability bug in Borzenkov Andrey
2004-10-22 12:52 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).