mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
fixes for amd64 compilation
This commit is contained in:
parent
e055443412
commit
91f20ab510
@ -184,23 +184,24 @@ static int table_lookup(uint16_t type, uint8_t * as, uint8_t * qs)
|
|||||||
struct dns_entry *d=dnsentry;
|
struct dns_entry *d=dnsentry;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
char *p,*q;
|
char *p,*q;
|
||||||
q = (char *)&(qs[1]);
|
q = (char *)&(qs[1]);
|
||||||
p = &(d->name[1]);
|
p = &(d->name[1]);
|
||||||
fprintf(stderr, "\n%s: %d/%d p:%s q:%s %d",
|
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
|
#endif
|
||||||
if (type == REQ_A) { /* search by host name */
|
if (type == REQ_A) { /* search by host name */
|
||||||
for (i = 1; i <= (int)(d->name[0]); i++)
|
for (i = 1; i <= (int)(d->name[0]); i++)
|
||||||
if (tolower(qs[i]) != d->name[i])
|
if (tolower(qs[i]) != d->name[i])
|
||||||
break;
|
break;
|
||||||
if (i > (int)(d->name[0])) {
|
if (i > (int)(d->name[0])) {
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
fprintf(stderr, " OK");
|
fprintf(stderr, " OK");
|
||||||
#endif
|
#endif
|
||||||
strcpy((char *)as, d->ip);
|
strcpy((char *)as, d->ip);
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
fprintf(stderr, " as:%s\n", as);
|
fprintf(stderr, " as:%s\n", as);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -190,9 +190,10 @@ static void handle_accept(isrv_state_t *state, int fd)
|
|||||||
{
|
{
|
||||||
int n, newfd;
|
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);
|
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 (newfd < 0) {
|
||||||
if (errno == EAGAIN) return;
|
if (errno == EAGAIN) return;
|
||||||
/* Most probably someone gave us wrong fd type
|
/* Most probably someone gave us wrong fd type
|
||||||
@ -299,7 +300,8 @@ void isrv_run(
|
|||||||
isrv_register_fd(state, /*peer:*/ 0, listen_fd);
|
isrv_register_fd(state, /*peer:*/ 0, listen_fd);
|
||||||
isrv_want_rd(state, listen_fd);
|
isrv_want_rd(state, listen_fd);
|
||||||
/* remember flags to make blocking<->nonblocking switch faster */
|
/* 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) {
|
while (1) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
printf "%9s %11s %9s %9s %s\n" "text+data" text+rodata rwdata bss filename
|
printf "%9s %11s %9s %9s %s\n" "text+data" text+rodata rwdata bss filename
|
||||||
find -name '*.o' | grep -v '^\./scripts/' | grep -vF built-in.o \
|
find -name '*.o' | grep -v '^\./scripts/' | grep -vF built-in.o \
|
||||||
| sed 's:^\./::' | xargs size | grep '^ *[0-9]' \
|
| sed 's:^\./::' | xargs "${CROSS_COMPILE}size" | grep '^ *[0-9]' \
|
||||||
| while read text data bss dec hex filename; do
|
| while read text data bss dec hex filename; do
|
||||||
printf "%9d %11d %9d %9d %s\n" $((text+data)) $text $data $bss "$filename"
|
printf "%9d %11d %9d %9d %s\n" $((text+data)) $text $data $bss "$filename"
|
||||||
done | sort -r
|
done | sort -r
|
||||||
|
Loading…
Reference in New Issue
Block a user