~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/chat.py

ivle.chat now opens /dev/null as std{in,out,err} when daemonising.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
            except OSError:
68
68
                pass
69
69
 
 
70
        si = os.open(os.devnull, os.O_RDONLY)
 
71
        os.dup2(si, sys.stdin.fileno())
 
72
 
 
73
        so = os.open(os.devnull, os.O_WRONLY)
 
74
        os.dup2(so, sys.stdout.fileno())
 
75
 
 
76
        se = os.open(os.devnull, os.O_WRONLY)
 
77
        os.dup2(se, sys.stderr.fileno())
 
78
 
70
79
    if initializer:
71
80
        initializer()
72
81