Skip to content

Commit

Permalink
Make it so root process cannot exit
Browse files Browse the repository at this point in the history
  • Loading branch information
remzi-arpacidusseau committed Mar 1, 2021
1 parent 51664fa commit 561fe0f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cpu-api/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def collect_children(self, p):

def do_exit(self, p):
# remove the process from the process list
if p == self.root_name:
print('root process: cannot exit')
exit(1)
exit_parent = self.parents[p]
self.process_list.remove(p)

Expand Down

0 comments on commit 561fe0f

Please sign in to comment.