← Commit list

9033453c1

Rob Landley
Rob Landley
2005-11-12
SOURCE BUG Duration: 7s

Subject

My last change to this file broke tar x. Sigh. (Trying to make sure we work on file sizes between 2 and 4 gigs on 32 bit machines. For supporting >4 gigs, just use a 64 bit machine already...)

SOURCE BUG

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)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/copyfd.c+5 -4
@@ -29,11 +29,13 @@ static ssize_t bb_full_fd_action(int src_fd, int dst_fd, size_t size)
RESERVE_CONFIG_BUFFER(buffer,BUFSIZ);
if (src_fd < 0) goto out;
-
while (!size || total < size)
{
- ssize_t wrote, xread = (size && size < BUFSIZ) ? size : BUFSIZ;
- xread = safe_read(src_fd, buffer, xread);
+ ssize_t wrote, xread;
+
+ xread = safe_read(src_fd, buffer,
+ (!size || size - total > BUFSIZ) ? BUFSIZ : size - total);
+
if (xread > 0) {
/* A -1 dst_fd means we need to fake it... */
wrote = (dst_fd < 0) ? xread : bb_full_write(dst_fd, buffer, xread);
@@ -42,7 +44,6 @@ static ssize_t bb_full_fd_action(int src_fd, int dst_fd, size_t size)
break;
}
total += wrote;
- size -= wrote;
} else if (xread < 0) {
bb_perror_msg(bb_msg_read_error);
break;