Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion leapp/libraries/stdlib/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ def _call(command, callback_raw=lambda fd, value: None, callback_linebuffered=la
elif stdin is not None:
raise TypeError('stdin has to be either a file descriptor or string, not "{!s}"'.format(type(stdin)))

ep = EventLoop()
pid = os.fork()
if pid > 0:
ep = EventLoop()
# Since pid > 0, we are in the parent process, so we have to close the write-end
# file descriptors
os.close(wstdout)
Expand Down Expand Up @@ -202,6 +202,8 @@ def _call(command, callback_raw=lambda fd, value: None, callback_linebuffered=la
# Wait for the child to finish
pid, status = os.wait()
ep.close()
os.close(stdout)
os.close(stderr)

# The status variable is a 16 bit value, where the lower octet describes
# the signal which killed the process, and the upper octet is the exit code
Expand Down