From: Eric S. Raymond Date: Sat, 31 May 2014 16:52:50 +0000 (-0400) Subject: Better behavior in case stdout was closed when irkerd was backgrounded. X-Git-Tag: 2.9~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=aa9db80e1020fc9cbad0325705014767e8af984a;p=irker.git Better behavior in case stdout was closed when irkerd was backgrounded. --- diff --git a/irkerd b/irkerd index 2c66a18..dd567e5 100755 --- a/irkerd +++ b/irkerd @@ -937,7 +937,10 @@ class IrkerUDPHandler(socketserver.BaseRequestHandler): def in_background(): "Is this process running in background?" - return os.getpgrp() != os.tcgetpgrp(1) + try: + return os.getpgrp() != os.tcgetpgrp(1) + except OSError: + return True if __name__ == '__main__': parser = argparse.ArgumentParser(