Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 244596

Summary: mock-0.7.1 fails to get child process return value
Product: [Retired] Fedora Hosted Projects Reporter: Fabrice Bellet <fabrice>
Component: mockAssignee: Michael E Brown <mebrown>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: dcantrell, fabrice, herrold, sheltren
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 0.7.4-1.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-03 02:41:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fabrice Bellet 2007-06-17 22:01:38 UTC
The problem occurs in mock-0.7.1 on Fedora 7, in the do() method. It seems to me
that the return status of the child process created by popen2.Popen4() is never
assigned to retval before exiting. So default value zero is always returned to
the parent process, and the consequence is that build errors are ignored by
mock. Here is a patch that makes it work for me:

--- /usr/bin/mock       2007-06-14 19:42:22.000000000 +0200
+++ /tmp/mock   2007-06-17 23:30:46.000000000 +0200
@@ -606,6 +606,9 @@
             for line in child.fromchild:
                 w.write(line)
             w.close()
+
+            retval = child.wait()
+
             os._exit( (retval & 0xFF00) >> 8 )

Comment 1 Jeff Sheltren 2007-07-18 12:46:33 UTC
*** Bug 246614 has been marked as a duplicate of this bug. ***

Comment 2 Michael E Brown 2007-07-18 18:13:01 UTC
patch accepted for 0.7.4
Thanks

Comment 3 Fedora Update System 2007-07-18 20:54:47 UTC
mock-0.7.4-1.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2007-08-03 02:41:19 UTC
mock-0.7.4-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.