MCPcopy
hub / github.com/sshuttle/sshuttle / start_hostwatch

Function start_hostwatch

sshuttle/server.py:140–159  ·  view source on GitHub ↗
(seed_hosts, auto_hosts)

Source from the content-addressed store, hash-verified

138
139
140def start_hostwatch(seed_hosts, auto_hosts):
141 s1, s2 = socket.socketpair()
142 pid = os.fork()
143 if not pid:
144 # child
145 rv = 99
146 try:
147 try:
148 s2.close()
149 os.dup2(s1.fileno(), 1)
150 os.dup2(s1.fileno(), 0)
151 s1.close()
152 rv = hostwatch.hw_main(seed_hosts, auto_hosts) or 0
153 except Exception:
154 log('%s' % _exc_dump())
155 rv = 98
156 finally:
157 os._exit(rv)
158 s1.close()
159 return pid, s2
160
161
162class Hostwatch:

Callers 1

got_host_reqFunction · 0.85

Calls 3

logFunction · 0.90
_exc_dumpFunction · 0.85
closeMethod · 0.80

Tested by

no test coverage detected