← Commit list

6d8ce170b

Rob Landley
Rob Landley
2006-06-07
SOURCE BUG Duration: 38s

Subject

Fix from Tito to read from stdin only when it's not a tty.

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 →

include/usage.h+1 -1
@@ -994,7 +994,7 @@ USE_FEATURE_DATE_ISOFMT( \
#define hdparm_trivial_usage \
"[options] [device] .."
#define hdparm_full_usage \
- USE_FEATURE_HDPARM_GET_IDENTITY("\tIf no device name is specified read from stdin.\n") \
+ USE_FEATURE_HDPARM_GET_IDENTITY("\tIf no device name is specified try to read from stdin.\n") \
"\nOptions:\n" \
"\t-a get/set fs readahead\n" \
"\t-A set drive read-lookahead flag (0/1)\n" \
miscutils/hdparm.c+3 -3
@@ -2185,11 +2185,11 @@ int hdparm_main(int argc, char **argv)
argc -= optind;
argv += optind;
-#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
if (argc < 1) {
- identify_from_stdin(); /* EXIT */
+ if (ENABLE_FEATURE_HDPARM_GET_IDENTITY && !isatty(STDIN_FILENO))
+ identify_from_stdin(); /* EXIT */
+ else bb_show_usage();
}
-#endif
while (argc--) {
process_dev(*argv);