Skip to content

Commit

Permalink
Print child PID on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
rspivak committed Jun 13, 2012
1 parent 0265f30 commit af4cb62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions server03.py
Expand Up @@ -78,6 +78,7 @@ def create_child(index, listen_sock):
if pid > 0: # parent if pid > 0: # parent
return pid return pid


print 'Child started with PID: %s' % os.getpid()
# child never returns # child never returns
child_loop(index, listen_sock) child_loop(index, listen_sock)


Expand Down
1 change: 1 addition & 0 deletions server03a.py
Expand Up @@ -81,6 +81,7 @@ def create_child(index, listen_sock):
if pid > 0: # parent if pid > 0: # parent
return pid return pid


print 'Child started with PID: %s' % os.getpid()
# child never returns # child never returns
try: try:
child_loop(index, listen_sock) child_loop(index, listen_sock)
Expand Down

0 comments on commit af4cb62

Please sign in to comment.