diff options
author | Denis Vlasenko | 2007-01-20 01:47:44 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-01-20 01:47:44 +0000 |
commit | 91f20ab510a6ddab49dd89f8c8876912d4537be0 (patch) | |
tree | f5cd515adbbc035cbc6b65df7569fcd04545a2b3 /networking | |
parent | e0554434126541e943bf0f1d90a475252392bf6f (diff) | |
download | busybox-91f20ab510a6ddab49dd89f8c8876912d4537be0.zip busybox-91f20ab510a6ddab49dd89f8c8876912d4537be0.tar.gz |
fixes for amd64 compilation
Diffstat (limited to 'networking')
-rw-r--r-- | networking/dnsd.c | 9 | ||||
-rw-r--r-- | networking/isrv.c | 8 |
2 files changed, 10 insertions, 7 deletions
diff --git a/networking/dnsd.c b/networking/dnsd.c index c3bd161..71f5042 100644 --- a/networking/dnsd.c +++ b/networking/dnsd.c @@ -184,23 +184,24 @@ static int table_lookup(uint16_t type, uint8_t * as, uint8_t * qs) struct dns_entry *d=dnsentry; do { -#ifdef DEBUG +#if DEBUG char *p,*q; q = (char *)&(qs[1]); p = &(d->name[1]); fprintf(stderr, "\n%s: %d/%d p:%s q:%s %d", - __FUNCTION__, strlen(p), (int)(d->name[0]), p, q, strlen(q)); + __FUNCTION__, (int)strlen(p), (int)(d->name[0]), + p, q, (int)strlen(q)); #endif if (type == REQ_A) { /* search by host name */ for (i = 1; i <= (int)(d->name[0]); i++) if (tolower(qs[i]) != d->name[i]) break; if (i > (int)(d->name[0])) { -#ifdef DEBUG +#if DEBUG fprintf(stderr, " OK"); #endif strcpy((char *)as, d->ip); -#ifdef DEBUG +#if DEBUG fprintf(stderr, " as:%s\n", as); #endif return 0; diff --git a/networking/isrv.c b/networking/isrv.c index 5193f30..f0df222 100644 --- a/networking/isrv.c +++ b/networking/isrv.c @@ -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; |