diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-06-10 14:32:56 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-06-10 14:32:56 +0000 |
commit | 62f9856f5468123605aab5ff3457febe21e8141c (patch) | |
tree | e489ebaafe8e1432f9eab22f41b18df1780f11ee /networking/tftp.c | |
parent | b25f98a417233f8c470ad61a6e191ff3aa8bd633 (diff) | |
download | busybox-w32-62f9856f5468123605aab5ff3457febe21e8141c.tar.gz busybox-w32-62f9856f5468123605aab5ff3457febe21e8141c.tar.bz2 busybox-w32-62f9856f5468123605aab5ff3457febe21e8141c.zip |
- revert incorrect select change
Diffstat (limited to 'networking/tftp.c')
-rw-r--r-- | networking/tftp.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/networking/tftp.c b/networking/tftp.c index e32c5de38..e1b6f403c 100644 --- a/networking/tftp.c +++ b/networking/tftp.c | |||
@@ -150,7 +150,7 @@ static int tftp(const int cmd, const struct hostent *host, | |||
150 | socklen_t fromlen; | 150 | socklen_t fromlen; |
151 | fd_set rfds; | 151 | fd_set rfds; |
152 | int socketfd; | 152 | int socketfd; |
153 | int len, itmp; | 153 | int len; |
154 | int opcode = 0; | 154 | int opcode = 0; |
155 | int finished = 0; | 155 | int finished = 0; |
156 | int timeout = TFTP_NUM_RETRIES; | 156 | int timeout = TFTP_NUM_RETRIES; |
@@ -308,8 +308,8 @@ static int tftp(const int cmd, const struct hostent *host, | |||
308 | FD_ZERO(&rfds); | 308 | FD_ZERO(&rfds); |
309 | FD_SET(socketfd, &rfds); | 309 | FD_SET(socketfd, &rfds); |
310 | 310 | ||
311 | itmp = select(socketfd + 1, &rfds, NULL, NULL, &tv); | 311 | switch (select(socketfd + 1, &rfds, NULL, NULL, &tv)) { |
312 | if (itmp == 1) { | 312 | case 1: |
313 | len = recvfrom(socketfd, buf, tftp_bufsize, 0, | 313 | len = recvfrom(socketfd, buf, tftp_bufsize, 0, |
314 | (struct sockaddr *) &from, &fromlen); | 314 | (struct sockaddr *) &from, &fromlen); |
315 | 315 | ||
@@ -330,8 +330,7 @@ static int tftp(const int cmd, const struct hostent *host, | |||
330 | /* fall-through for bad packets! */ | 330 | /* fall-through for bad packets! */ |
331 | /* discard the packet - treat as timeout */ | 331 | /* discard the packet - treat as timeout */ |
332 | timeout = TFTP_NUM_RETRIES; | 332 | timeout = TFTP_NUM_RETRIES; |
333 | 333 | case 0: | |
334 | } else if (itmp == 0) { | ||
335 | bb_error_msg("timeout"); | 334 | bb_error_msg("timeout"); |
336 | 335 | ||
337 | timeout--; | 336 | timeout--; |
@@ -340,8 +339,7 @@ static int tftp(const int cmd, const struct hostent *host, | |||
340 | bb_error_msg("last timeout"); | 339 | bb_error_msg("last timeout"); |
341 | } | 340 | } |
342 | break; | 341 | break; |
343 | 342 | default: | |
344 | } else { | ||
345 | bb_perror_msg("select"); | 343 | bb_perror_msg("select"); |
346 | len = -1; | 344 | len = -1; |
347 | } | 345 | } |