start_stop_daemon: NOMMU fixes, round 2 by Alex Landau <landau_alex@yahoo.com>
[oweals/busybox.git] / networking / isrv.c
index 5193f30f33a8a8665bf388cdadfcefa5754ff7e1..a51618af10ad2b676cd7229d64bd6f15917e3a4d 100644 (file)
@@ -8,7 +8,7 @@
  * Licensed under GPL version 2, see file LICENSE in this tarball for details.
  */
 
-#include "busybox.h"
+#include "libbb.h"
 #include "isrv.h"
 
 #define DEBUG 0
@@ -190,9 +190,10 @@ static void handle_accept(isrv_state_t *state, int fd)
 {
        int n, newfd;
 
-       fcntl(fd, F_SETFL, (int)(PARAM_TBL[0]) | O_NONBLOCK);
+       /* suppress gcc warning "cast from ptr to int of different size" */
+       fcntl(fd, F_SETFL, (int)(ptrdiff_t)(PARAM_TBL[0]) | O_NONBLOCK);
        newfd = accept(fd, NULL, 0);
-       fcntl(fd, F_SETFL, (int)(PARAM_TBL[0]));
+       fcntl(fd, F_SETFL, (int)(ptrdiff_t)(PARAM_TBL[0]));
        if (newfd < 0) {
                if (errno == EAGAIN) return;
                /* Most probably someone gave us wrong fd type
@@ -299,7 +300,8 @@ void isrv_run(
        isrv_register_fd(state, /*peer:*/ 0, listen_fd);
        isrv_want_rd(state, listen_fd);
        /* remember flags to make blocking<->nonblocking switch faster */
-       PARAM_TBL[0] = (void*) (fcntl(listen_fd, F_GETFL, 0));
+       /* (suppress gcc warning "cast from ptr to int of different size") */
+       PARAM_TBL[0] = (void*)(ptrdiff_t)(fcntl(listen_fd, F_GETFL, 0));
 
        while (1) {
                struct timeval tv;