Skip to content

Commit 80079ae

Browse files
author
duanhongyi
committed
change sdns
1 parent 37717ca commit 80079ae

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

bin/sdns.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ def prepare_run(run_env):
117117
run_env['tcp'].append([f,ip])
118118
run_env['udp'].append([p,ip])
119119

120-
def sdns_write_pid(pid_file):
120+
def write_pid(pid_file):
121121
pid = str(os.getpid())
122122
with open(pid_file, 'w') as f:
123123
f.write(pid)
124124

125125

126-
def sdns_kill_pid(pid_file):
126+
def kill_pid(pid_file):
127127
if not os.path.exists(pid_file): return
128128
try:
129129
with open(pid_file, 'r') as f:
@@ -141,12 +141,12 @@ def sdns_kill_pid(pid_file):
141141
'..',
142142
'sdns.pid',
143143
)
144-
sdns_kill_pid(pid_file)
144+
kill_pid(pid_file)
145145
run_env = {'udp':[], 'tcp':[], 'closed':0, 'updated': False, 'finder':None}
146146
prepare_run(run_env)
147147
for e in run_env['tcp']:
148148
reactor.listenTCP(53, e[0], interface=e[1])
149149
for e in run_env['udp']:
150150
reactor.listenUDP(53, e[0], interface=e[1])
151-
sdns_write_pid(pid_file)
151+
write_pid(pid_file)
152152
reactor.run()

0 commit comments

Comments
 (0)