aboutsummaryrefslogtreecommitdiff
path: root/networking/isrv.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/isrv.c')
-rw-r--r--networking/isrv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/networking/isrv.c b/networking/isrv.c
index 5193f30f3..f0df2229c 100644
--- a/networking/isrv.c
+++ b/networking/isrv.c
@@ -190,9 +190,10 @@ static void handle_accept(isrv_state_t *state, int fd)
190{ 190{
191 int n, newfd; 191 int n, newfd;
192 192
193 fcntl(fd, F_SETFL, (int)(PARAM_TBL[0]) | O_NONBLOCK); 193 /* suppress gcc warning "cast from ptr to int of different size" */
194 fcntl(fd, F_SETFL, (int)(ptrdiff_t)(PARAM_TBL[0]) | O_NONBLOCK);
194 newfd = accept(fd, NULL, 0); 195 newfd = accept(fd, NULL, 0);
195 fcntl(fd, F_SETFL, (int)(PARAM_TBL[0])); 196 fcntl(fd, F_SETFL, (int)(ptrdiff_t)(PARAM_TBL[0]));
196 if (newfd < 0) { 197 if (newfd < 0) {
197 if (errno == EAGAIN) return; 198 if (errno == EAGAIN) return;
198 /* Most probably someone gave us wrong fd type 199 /* Most probably someone gave us wrong fd type
@@ -299,7 +300,8 @@ void isrv_run(
299 isrv_register_fd(state, /*peer:*/ 0, listen_fd); 300 isrv_register_fd(state, /*peer:*/ 0, listen_fd);
300 isrv_want_rd(state, listen_fd); 301 isrv_want_rd(state, listen_fd);
301 /* remember flags to make blocking<->nonblocking switch faster */ 302 /* remember flags to make blocking<->nonblocking switch faster */
302 PARAM_TBL[0] = (void*) (fcntl(listen_fd, F_GETFL, 0)); 303 /* (suppress gcc warning "cast from ptr to int of different size") */
304 PARAM_TBL[0] = (void*)(ptrdiff_t)(fcntl(listen_fd, F_GETFL, 0));
303 305
304 while (1) { 306 while (1) {
305 struct timeval tv; 307 struct timeval tv;