File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ def changed(fname):
113113 [util .close_on_exec (s ) for s in self .sockets ]
114114 util .close_on_exec (self .tmp .fileno ())
115115
116+ self .wait_fds = self .sockets + [self .PIPE [0 ]]
117+
116118 self .log .close_on_exec ()
117119
118120 self .init_signals ()
@@ -164,6 +166,9 @@ def init_signals(self):
164166 signal .siginterrupt (signal .SIGTERM , False )
165167 signal .siginterrupt (signal .SIGUSR1 , False )
166168
169+ if hasattr (signal , 'set_wakeup_fd' ):
170+ signal .set_wakeup_fd (self .PIPE [1 ])
171+
167172 def handle_usr1 (self , sig , frame ):
168173 self .log .reopen_files ()
169174
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def accept(self, listener):
3232 def wait (self , timeout ):
3333 try :
3434 self .notify ()
35- ret = select .select (self .sockets , [], self . PIPE , timeout )
35+ ret = select .select (self .wait_fds , [], [] , timeout )
3636 if ret [0 ]:
3737 return ret [0 ]
3838
@@ -93,6 +93,9 @@ def run_for_multiple(self, timeout):
9393
9494 if ready is not None :
9595 for listener in ready :
96+ if listener == self .PIPE [0 ]:
97+ continue
98+
9699 try :
97100 self .accept (listener )
98101 except EnvironmentError as e :
You can’t perform that action at this time.
0 commit comments