diff options
author | jmg <jmg@FreeBSD.org> | 2003-06-15 03:05:14 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2003-06-15 03:05:14 +0000 |
commit | 215585360bcfca47cd86079acc2ae21493a54ada (patch) | |
tree | 34eb01b403fef6694d3b10c4636305dcab4ae664 | |
parent | d23b391c61b055b1ac13838d51c5a87c7289d260 (diff) | |
download | FreeBSD-src-215585360bcfca47cd86079acc2ae21493a54ada.zip FreeBSD-src-215585360bcfca47cd86079acc2ae21493a54ada.tar.gz |
fix bootpd to use fd_set. For some reason on Sparc, using int with
select is broken.
-rw-r--r-- | libexec/bootpd/bootpd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libexec/bootpd/bootpd.c b/libexec/bootpd/bootpd.c index 1fd2f6e..d4af2e1 100644 --- a/libexec/bootpd/bootpd.c +++ b/libexec/bootpd/bootpd.c @@ -186,7 +186,8 @@ main(argc, argv) struct hostent *hep; char *stmp; int n, ba_len, ra_len; - int nfound, readfds; + int nfound; + fd_set readfds; int standalone; #ifdef SA_NOCLDSTOP /* Have POSIX sigaction(2). */ struct sigaction sa; @@ -503,14 +504,15 @@ main(argc, argv) /* * Process incoming requests. */ + FD_ZERO(&readfds); for (;;) { struct timeval tv; - readfds = 1 << s; + FD_SET(s, &readfds); if (timeout) tv = *timeout; - nfound = select(s + 1, (fd_set *)&readfds, NULL, NULL, + nfound = select(s + 1, &readfds, NULL, NULL, (timeout) ? &tv : NULL); if (nfound < 0) { if (errno != EINTR) { @@ -530,7 +532,7 @@ main(argc, argv) } continue; } - if (!(readfds & (1 << s))) { + if (!FD_ISSET(s, &readfds)) { if (debug > 1) report(LOG_INFO, "exiting after %ld minutes of inactivity", actualtimeout.tv_sec / 60); |