From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.50) id 1EVoSX-0002fC-48 for garchives@archives.gentoo.org; Sat, 29 Oct 2005 11:01:13 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id j9TB0XdL024295; Sat, 29 Oct 2005 11:00:33 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id j9TB0WaS024822 for ; Sat, 29 Oct 2005 11:00:33 GMT Received: from zh034158.ppp.dion.ne.jp ([222.3.34.158] helo=opteron246.suzuki-stubbs.home) by smtp.gentoo.org with esmtpa (Exim 4.43) id 1EVoRs-0002Bx-L4 for gentoo-portage-dev@lists.gentoo.org; Sat, 29 Oct 2005 11:00:32 +0000 Received: by opteron246.suzuki-stubbs.home (Postfix, from userid 1000) id 55D96248ADB; Sat, 29 Oct 2005 20:01:37 +0900 (JST) From: Jason Stubbs To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [7/7] portage_exec cleanups Date: Sat, 29 Oct 2005 20:01:37 +0900 User-Agent: KMail/1.8.92 References: <200510231545.16596.jstubbs@gentoo.org> <200510291934.13207.jstubbs@gentoo.org> In-Reply-To: <200510291934.13207.jstubbs@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_Ra1YDn30rHJnTWq" Message-Id: <200510292001.37237.jstubbs@gentoo.org> X-Archives-Salt: 7e6b8c35-1354-47aa-8a80-7eb616f6a8b9 X-Archives-Hash: e4bc7aa5f0b7cf39fb9a5d2468bc3f53 --Boundary-00=_Ra1YDn30rHJnTWq Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Remove the unused code block prior to execve'ing and all the superfluous exits. To be specific, if os.execve succeeds then python is gone. If it doesn't succeed then an exception will be raised. The previous code raised the exception meaning that python would exit (on the child thread side) and portage exit handlers would be called. The os._exit(1) and friends weren't ever called at all. --Boundary-00=_Ra1YDn30rHJnTWq Content-Type: text/x-diff; charset="utf-8"; name="07-execvp-failure-handling.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="07-execvp-failure-handling.patch" --- portage_exec.py.orig 2005-10-29 19:21:38.000000000 +0900 +++ portage_exec.py 2005-10-29 19:22:13.000000000 +0900 @@ -100,28 +100,12 @@ os.setuid(uid) if umask: os.umask(umask) - try: - # XXX: We would do this to stop ebuild.sh from getting any - # XXX: output, and consequently, we'd get to handle the sigINT. - #os.close(sys.stdin.fileno()) - pass - except SystemExit, e: - raise - except: - pass try: - #print "execing", myc, myargs os.execve(myc,myargs,env) - except SystemExit, e: - raise except Exception, e: - raise str(e)+":\n "+myc+" "+string.join(myargs) - # If the execve fails, we need to report it, and exit - # *carefully* --- report error here - os._exit(1) - sys.exit(1) - return # should never get reached + print str(e)+":\n "+myc+" "+string.join(myargs) + os._exit(1) if logfile: os.close(pw) --Boundary-00=_Ra1YDn30rHJnTWq-- -- gentoo-portage-dev@gentoo.org mailing list