Skip to content
Snippets Groups Projects
Commit 944ba08d authored by Edward Hicks's avatar Edward Hicks :8ball:
Browse files

wait for forked processes to return before resuming

parent 47db1bb7
No related branches found
No related tags found
No related merge requests found
Pipeline #92230 passed
......@@ -2,7 +2,7 @@
from __future__ import print_function
import sys
import os
from subprocess import call
import subprocess
import time
import argparse
import re
......@@ -492,8 +492,10 @@ while True:
pid = os.fork()
if pid == 0:
#sys.exit(os.system(command))
sys.exit(call(command, shell=True))
proc = subprocess.run(command, shell=True)
sys.exit(proc.returncode)
printLog("Forked '"+command+"' as "+str(pid), loglevels.INFO)
os.waitpid(pid)
except KeyError as e:
# No valid operation messages were found
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment