← Commit list

74afa9aed

Glenn L McGrath
Glenn L McGrath
2001-11-21
TIMEOUT Duration: 626s

Subject

When just counting chars of a file stat file instead of reading the whole file (Fixes Debian bug #103302)

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

$ git checkout -f 74afa9aed1b099c6b0af881760a5de74be521f1f
HEAD is now at 74afa9aed When just counting chars of a file stat file instead of reading the whole file (Fixes Debian bug #103302)

$ git clean -fdx
Removing .menuconfig.log
Removing MCmenu0
Removing MCmenu1
Removing MCmenu2
Removing MCmenu3
Removing MCmenu4
Removing include/config/
Removing scripts/lxdialog/checklist.o
Removing scripts/lxdialog/inputbox.o
Removing scripts/lxdialog/lxdialog
Removing scripts/lxdialog/lxdialog.o
Removing scripts/lxdialog/menubox.o
Removing scripts/lxdialog/msgbox.o
Removing scripts/lxdialog/textbox.o
Removing scripts/lxdialog/util.o
Removing scripts/lxdialog/yesno.o

$ make SHELL=/bin/bash CC=/root/asi_db/compat/cc-wrapper.sh HOSTCC=/root/asi_db/compat/cc-wrapper.sh defconfig
make: *** No rule to make target 'defconfig'.  Stop.

$ make SHELL=/bin/bash CC=/root/asi_db/compat/cc-wrapper.sh HOSTCC=/root/asi_db/compat/cc-wrapper.sh allnoconfig
make: *** No rule to make target 'allnoconfig'.  Stop.

$ make SHELL=/bin/bash CC=/root/asi_db/compat/cc-wrapper.sh HOSTCC=/root/asi_db/compat/cc-wrapper.sh include/bb_config.h
make: *** No rule to make target 'include/bb_config.h'.  Stop.

$ make SHELL=/bin/bash CC=/root/asi_db/compat/cc-wrapper.sh HOSTCC=/root/asi_db/compat/cc-wrapper.sh -j3 V=1

[TIMEOUT]

Commit Diff GitHub →

coreutils/wc.c+8 -4
@@ -143,11 +143,15 @@ int wc_main(int argc, char **argv)
return EXIT_SUCCESS;
} else {
while (optind < argc) {
- file = wfopen(argv[optind], "r");
- if (file != NULL)
+ if (print_type == print_chars) {
+ struct stat statbuf;
+ stat(argv[optind], &statbuf);
+ print_counts(0, 0, statbuf.st_size, 0, argv[optind]);
+ total_chars += statbuf.st_size;
+ } else {
+ file = xfopen(argv[optind], "r");
wc_file(file, argv[optind]);
- else
- status = EXIT_FAILURE;
+ }
num_files_counted++;
optind++;
}