Aurelien Jacobs pointed out inline functions that could be removed. Doing so shrank the code a bit.
This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)
No binary (build failed)
—
(log yok)
| @@ -39,7 +39,6 @@ | |
| #define EOT 0x04 | |
| #define ACK 0x06 | |
| #define NAK 0x15 | |
| - | #define CAN 0x18 |
| #define BS 0x08 | |
| /* | |
| @@ -57,18 +56,6 @@ Cf: | |
| #define TIMEOUT_LONG 10 | |
| #define MAXERRORS 10 | |
| - | static inline void write_byte(int fd, char cc) { |
| - | write(fd, &cc, 1); |
| - | } |
| - | |
| - | static inline void write_flush(int fd) { |
| - | tcdrain(fd); |
| - | } |
| - | |
| - | static inline void read_flush(int fd) { |
| - | tcflush(fd, TCIFLUSH); |
| - | } |
| - | |
| static int read_byte(int fd, unsigned int timeout) { | |
| char buf[1]; | |
| int n; | |
| @@ -99,11 +86,11 @@ static int receive(char *error_buf, size_t error_buf_size, | |
| #define note_error(fmt,args...) \ | |
| snprintf(error_buf, error_buf_size, fmt,##args) | |
| - | read_flush(ttyfd); |
| + | /* Flush pending input */ |
| + | tcflush(ttyfd, TCIFLUSH); |
| /* Ask for CRC; if we get errors, we will go with checksum */ | |
| - | write_byte(ttyfd, nak); |
| - | write_flush(ttyfd); |
| + | write(ttyfd, &nak, 1); |
| for (;;) { | |
| int blockBegin; | |
| @@ -126,8 +113,8 @@ static int receive(char *error_buf, size_t error_buf_size, | |
| break; | |
| case EOT: | |
| - | write_byte(ttyfd, ACK); |
| - | write_flush(ttyfd); |
| + | nak = ACK; |
| + | write(ttyfd, &nak, 1); |
| goto done; | |
| default: | |
| @@ -232,8 +219,8 @@ static int receive(char *error_buf, size_t error_buf_size, | |
| next: | |
| errors = 0; | |
| - | write_byte(ttyfd, ACK); |
| - | write_flush(ttyfd); |
| + | nak = ACK; |
| + | write(ttyfd, &nak, 1); |
| continue; | |
| error: | |
| @@ -241,7 +228,6 @@ static int receive(char *error_buf, size_t error_buf_size, | |
| errors++; | |
| if (errors == MAXERRORS) { | |
| /* Abort */ | |
| - | int i; |
| // if using crc, try again w/o crc | |
| if (nak == 'C') { | |
| @@ -254,17 +240,15 @@ static int receive(char *error_buf, size_t error_buf_size, | |
| note_error("too many errors; giving up"); | |
| fatal: | |
| - | for (i = 0; i < 5; i ++) |
| - | write_byte(ttyfd, CAN); |
| - | for (i = 0; i < 5; i ++) |
| - | write_byte(ttyfd, BS); |
| - | write_flush(ttyfd); |
| + | /* 5 CAN followed by 5 BS */ |
| + | write(ttyfd, "\030\030\030\030\030\010\010\010\010\010", 10); |
| return -1; | |
| } | |
| - | read_flush(ttyfd); |
| - | write_byte(ttyfd, nak); |
| - | write_flush(ttyfd); |
| + | /* Flush pending input */ |
| + | tcflush(ttyfd, TCIFLUSH); |
| + | |
| + | write(ttyfd, &nak, 1); |
| } | |
| done: | |