MCPcopy
hub / github.com/shadowsocks/shadowsocks / freopen

Function freopen

shadowsocks/daemon.py:85–90  ·  view source on GitHub ↗
(f, mode, stream)

Source from the content-addressed store, hash-verified

83
84
85def freopen(f, mode, stream):
86 oldf = open(f, mode)
87 oldfd = oldf.fileno()
88 newfd = stream.fileno()
89 os.close(newfd)
90 os.dup2(oldfd, newfd)
91
92
93def daemon_start(pid_file, log_file):

Callers 1

daemon_startFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected