File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ void child_main_loop (void)
99
99
100
100
/*
101
101
* We have to wait for connections on multiple fds,
102
- * so use select.
102
+ * so use select/poll/whatever .
103
103
*/
104
104
while (!config -> quit ) {
105
105
@@ -136,11 +136,11 @@ void child_main_loop (void)
136
136
if (errno == EINTR ) {
137
137
continue ;
138
138
}
139
- log_message (LOG_ERR , "error calling select : %s" ,
139
+ log_message (LOG_ERR , "error calling " SELECT_OR_POLL " : %s" ,
140
140
strerror (errno ));
141
141
continue ;
142
142
} else if (ret == 0 ) {
143
- log_message (LOG_WARNING , "Strange: select returned 0 "
143
+ log_message (LOG_WARNING , "Strange: " SELECT_OR_POLL " returned 0 "
144
144
"but we did not specify a timeout..." );
145
145
continue ;
146
146
}
@@ -158,7 +158,7 @@ void child_main_loop (void)
158
158
159
159
if (listenfd == -1 ) {
160
160
log_message (LOG_WARNING , "Strange: None of our listen "
161
- "fds was readable after select" );
161
+ "fds was readable after " SELECT_OR_POLL );
162
162
continue ;
163
163
}
164
164
Original file line number Diff line number Diff line change 4
4
#include "config.h"
5
5
6
6
#ifdef HAVE_POLL_H
7
+ #define SELECT_OR_POLL "poll"
7
8
8
9
#include <poll.h>
9
10
typedef struct pollfd pollfd_struct ;
@@ -13,6 +14,7 @@ typedef struct pollfd pollfd_struct;
13
14
14
15
#else
15
16
17
+ #define SELECT_OR_POLL "select"
16
18
#include <sys/select.h>
17
19
typedef struct mypollfd {
18
20
int fd ;
Original file line number Diff line number Diff line change @@ -1163,11 +1163,11 @@ static void relay_connection (struct conn_s *connptr)
1163
1163
1164
1164
if (ret == 0 ) {
1165
1165
log_message (LOG_INFO ,
1166
- "Idle Timeout (after select )" );
1166
+ "Idle Timeout (after " SELECT_OR_POLL " )" );
1167
1167
return ;
1168
1168
} else if (ret < 0 ) {
1169
1169
log_message (LOG_ERR ,
1170
- "relay_connection: select () error \"%s\". "
1170
+ "relay_connection: " SELECT_OR_POLL " () error \"%s\". "
1171
1171
"Closing connection (client_fd:%d, server_fd:%d)" ,
1172
1172
strerror (errno ), connptr -> client_fd ,
1173
1173
connptr -> server_fd );
@@ -1440,7 +1440,7 @@ get_request_entity(struct conn_s *connptr)
1440
1440
1441
1441
if (ret == -1 ) {
1442
1442
log_message (LOG_ERR ,
1443
- "Error calling select on client fd %d: %s" ,
1443
+ "Error calling " SELECT_OR_POLL " on client fd %d: %s" ,
1444
1444
connptr -> client_fd , strerror (errno ));
1445
1445
} else if (ret == 0 ) {
1446
1446
log_message (LOG_INFO , "no entity" );
@@ -1459,7 +1459,7 @@ get_request_entity(struct conn_s *connptr)
1459
1459
ret = 0 ;
1460
1460
}
1461
1461
} else {
1462
- log_message (LOG_ERR , "strange situation after select : "
1462
+ log_message (LOG_ERR , "strange situation after " SELECT_OR_POLL " : "
1463
1463
"ret = %d, but client_fd (%d) is not readable..." ,
1464
1464
ret , connptr -> client_fd );
1465
1465
ret = -1 ;
You can’t perform that action at this time.
0 commit comments