summaryrefslogtreecommitdiff
path: root/misc/py-pexpect/files/patch-pexpect.py
diff options
context:
space:
mode:
authorMark Linimon <linimon@FreeBSD.org>2004-05-10 19:27:15 +0000
committerMark Linimon <linimon@FreeBSD.org>2004-05-10 19:27:15 +0000
commit8a4b4d2c5ce4047a5a79be647d3eaec3166b5aa0 (patch)
tree1f296495c5d690b904d3447b7db386216fb3cf7e /misc/py-pexpect/files/patch-pexpect.py
parentUpgrade to 2.0b7 and unbreak. (diff)
Update to 0.999 and work around buggy getpid() implementations in compiler.
PR: ports/65846 Submitted by: Marco Molteni <mmolteni@cisco.com>
Notes
Notes: svn path=/head/; revision=108869
Diffstat (limited to 'misc/py-pexpect/files/patch-pexpect.py')
-rw-r--r--misc/py-pexpect/files/patch-pexpect.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/misc/py-pexpect/files/patch-pexpect.py b/misc/py-pexpect/files/patch-pexpect.py
new file mode 100644
index 000000000000..37263f96a784
--- /dev/null
+++ b/misc/py-pexpect/files/patch-pexpect.py
@@ -0,0 +1,29 @@
+--- pexpect.py.orig Mon Apr 26 14:16:08 2004
++++ pexpect.py Mon Apr 26 14:19:45 2004
+@@ -498,21 +498,24 @@ class spawn:
+ pid, status = os.waitpid(self.pid, os.WNOHANG)
+ except OSError:
+ return 0
+
+ # I have to do this twice for Solaris.
+ # I can't even believe that I figured this out...
+- if pid == 0 and status == 0:
++
++ # If waitpid() returns 0 it means that no child process wishes to
++ # report, and the value of status is undefined.
++ if pid == 0:
+ try:
+ pid, status = os.waitpid(self.pid, os.WNOHANG)
+ #print 'Solaris sucks'
+ except OSError: # This is crufty. When does this happen?
+ return 0
+ # If pid and status is still 0 after two calls to waitpid() then
+ # the process really is alive. This seems to work on all platforms.
+- if pid == 0 and status == 0:
++ if pid == 0:
+ return 1
+
+ # I do not OR this together because I want hooks for debugging.
+ if os.WIFEXITED (status):
+ self.exitstatus = os.WEXITSTATUS(status)
+ return 0