From: stevenknight Date: Fri, 7 Feb 2003 17:38:08 +0000 (+0000) Subject: Add a patch to help many systems terminate on interrupt. (Michael Cook) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=69aa280fa61cd57cbc87bc75e347d9c7e46ac38b;p=scons.git Add a patch to help many systems terminate on interrupt. (Michael Cook) git-svn-id: http://scons.tigris.org/svn/scons/trunk@577 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 9f45dbd5..6ae86ec2 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -16,6 +16,11 @@ RELEASE 0.11 - XXX - Support using the MSVC tool chain when running Cygwin Python. + From Michael Cook: + + - Avoid losing signal bits in the exit status from a command, + helping terminate builds on interrupt (CTRL+C). + From Charles Crain: - Added new AddPreAction() and AddPostAction() functions that support diff --git a/src/RELEASE.txt b/src/RELEASE.txt index f6fef164..6e76dd61 100644 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -196,6 +196,13 @@ RELEASE 0.10 - Thu, 16 Jan 2003 04:11:46 -0600 If you don't supply a space (for example, "<$SOURCE"), SCons will not recognize the redirection. + - People have reported problems with SCons not stopping a build when + an interrupt (CTRL+C) is received. A fix was checked in to 0.11 + that should fix this behavior on many systems, but there are + issues with the underlying Python os.system() call that suggest + this fix does not work on all systems or in all circumstances. + We're working to try to find a universal solution. + - Executing the -u or -U option from a source directory that has an associated BuildDir() does not build the targets in the BuildDir(). diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py index 4fb0cd82..777b9289 100644 --- a/src/engine/SCons/Platform/posix.py +++ b/src/engine/SCons/Platform/posix.py @@ -59,7 +59,10 @@ def env_spawn(sh, escape, cmd, args, env): else: s = string.join(args) - return os.system(s) >> 8 + stat = os.system(s) + if stat & 0xff: + return stat | 0x80 + return stat >> 8 def fork_spawn(sh, escape, cmd, args, env): pid = os.fork() @@ -76,8 +79,9 @@ def fork_spawn(sh, escape, cmd, args, env): else: # Parent process. pid, stat = os.waitpid(pid, 0) - ret = stat >> 8 - return ret + if stat & 0xff: + return stat | 0x80 + return stat >> 8 def generate(env):