← Commit list

c4b673994

Rob Landley
Rob Landley
2006-06-13
SOURCE BUG Duration: 35s

Subject

Use xstat() instead of if(stat()) die()

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 →

archival/bunzip2.c+1 -4
@@ -50,10 +50,7 @@ int bunzip2_main(int argc, char **argv)
if (strcmp(extension, ".bz2") != 0) {
bb_error_msg_and_die("Invalid extension");
}
- /* TODO: xstat */
- if (stat(filename, &stat_buf) < 0) {
- bb_error_msg_and_die("Couldn't stat file %s", filename);
- }
+ xstat(filename, &stat_buf);
*extension=0;
dst_fd = bb_xopen3(filename, O_WRONLY | O_CREAT, stat_buf.st_mode);
} else dst_fd = STDOUT_FILENO;
archival/uncompress.c+3 -5
@@ -61,11 +61,9 @@ int uncompress_main(int argc, char **argv)
*extension = '\0';
/* Open output file */
- dst_fd = bb_xopen(uncompressed_file, O_WRONLY | O_CREAT);
-
- /* Set permissions on the file */
- stat(compressed_file, &stat_buf);
- chmod(uncompressed_file, stat_buf.st_mode);
+ xstat(compressed_file, &stat_buf);
+ dst_fd = bb_xopen3(uncompressed_file, O_WRONLY | O_CREAT,
+ stat_buf.st_mode);
/* If unzip succeeds remove the old file */
delete_path = compressed_file;
archival/unlzma.c+1 -4
@@ -47,10 +47,7 @@ int unlzma_main(int argc, char **argv)
if (strcmp(extension, ".lzma") != 0) {
bb_error_msg_and_die("Invalid extension");
}
- /* TODO: xstat? */
- if (stat(filename, &stat_buf) < 0) {
- bb_error_msg_and_die("Couldn't stat file %s", filename);
- }
+ xstat(filename, &stat_buf);
*extension = 0;
dst_fd = bb_xopen3(filename, O_WRONLY | O_CREAT, stat_buf.st_mode);
} else