Skip to content

Commit

Permalink
#216 Wait for process1 to finish before checking return code
Browse files Browse the repository at this point in the history
  • Loading branch information
singhd789 committed Nov 27, 2024
1 parent 67ddb84 commit a7f3ee9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fre/make/gfdlfremake/buildBaremetal.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,14 @@ def run(self):
# Direct output to log file as well
p2 = subprocess.Popen(["tee",self.bld+"/log.compile"], stdin=p1.stdout)

# Allow p1 to receive SIGPIPE is p2 exits
# Allow process1 to receive SIGPIPE is process2 exits
p1.stdout.close()
p2.communicate()

# wait for process1 to finish before checking return code
p1.wait()
if p1.returncode != 0:
print(f"\nThere was an error running {self.bld}/compile.sh")
print(f"Check the log file: {self.bld}/log.compile")
else:
print(f"\nSuccessful run of {self.bld}/compile.sh")

0 comments on commit a7f3ee9

Please sign in to comment.