@@ -180,6 +180,7 @@ selector_thread_wakeup_drain_pipes (void)
180
180
{
181
181
gchar buffer [128 ];
182
182
gint received ;
183
+ static gint warnings_issued = 0 ;
183
184
184
185
for (;;) {
185
186
#if !defined(HOST_WIN32 )
@@ -192,20 +193,30 @@ selector_thread_wakeup_drain_pipes (void)
192
193
* some unices (like AIX) send ERESTART, which doesn't
193
194
* exist on some other OSes errno
194
195
*/
195
- if (errno != EINTR && errno != EAGAIN && errno != ERESTART )
196
+ if (errno != EINTR && errno != EAGAIN && errno != ERESTART ) {
196
197
#else
197
- if (errno != EINTR && errno != EAGAIN )
198
+ if (errno != EINTR && errno != EAGAIN ) {
198
199
#endif
199
- g_warning ("selector_thread_wakeup_drain_pipes: read () failed, error (%d) %s\n" , errno , g_strerror (errno ));
200
+ // limit amount of spam we write
201
+ if (warnings_issued < 100 ) {
202
+ g_warning ("selector_thread_wakeup_drain_pipes: read () failed, error (%d) %s\n" , errno , g_strerror (errno ));
203
+ warnings_issued ++ ;
204
+ }
205
+ }
200
206
break ;
201
207
}
202
208
#else
203
209
received = recv (threadpool_io -> wakeup_pipes [0 ], buffer , sizeof (buffer ), 0 );
204
210
if (received == 0 )
205
211
break ;
206
212
if (received == SOCKET_ERROR ) {
207
- if (WSAGetLastError () != WSAEINTR && WSAGetLastError () != WSAEWOULDBLOCK )
208
- g_warning ("selector_thread_wakeup_drain_pipes: recv () failed, error (%d)\n" , WSAGetLastError ());
213
+ if (WSAGetLastError () != WSAEINTR && WSAGetLastError () != WSAEWOULDBLOCK ) {
214
+ // limit amount of spam we write
215
+ if (warnings_issued < 100 ) {
216
+ g_warning ("selector_thread_wakeup_drain_pipes: recv () failed, error (%d)\n" , WSAGetLastError ());
217
+ warnings_issued ++ ;
218
+ }
219
+ }
209
220
break ;
210
221
}
211
222
#endif
0 commit comments