aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-06-07 21:22:42 +0000
committerRob Landley <rob@landley.net>2006-06-07 21:22:42 +0000
commit6d8ce170b0be743f761244f467cdaa5f4318638d (patch)
tree9eb1bcdc6c73b7512c3611911275f28d06ec94c5
parent5929edc1fac4340f99ed84e92bf3a2bedd4177c2 (diff)
downloadbusybox-w32-6d8ce170b0be743f761244f467cdaa5f4318638d.tar.gz
busybox-w32-6d8ce170b0be743f761244f467cdaa5f4318638d.tar.bz2
busybox-w32-6d8ce170b0be743f761244f467cdaa5f4318638d.zip
Fix from Tito to read from stdin only when it's not a tty.
-rw-r--r--include/usage.h2
-rw-r--r--miscutils/hdparm.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/include/usage.h b/include/usage.h
index 9bdfb3fe0..0349f6916 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -994,7 +994,7 @@ USE_FEATURE_DATE_ISOFMT( \
994#define hdparm_trivial_usage \ 994#define hdparm_trivial_usage \
995 "[options] [device] .." 995 "[options] [device] .."
996#define hdparm_full_usage \ 996#define hdparm_full_usage \
997 USE_FEATURE_HDPARM_GET_IDENTITY("\tIf no device name is specified read from stdin.\n") \ 997 USE_FEATURE_HDPARM_GET_IDENTITY("\tIf no device name is specified try to read from stdin.\n") \
998 "\nOptions:\n" \ 998 "\nOptions:\n" \
999 "\t-a get/set fs readahead\n" \ 999 "\t-a get/set fs readahead\n" \
1000 "\t-A set drive read-lookahead flag (0/1)\n" \ 1000 "\t-A set drive read-lookahead flag (0/1)\n" \
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index 5703eceb5..512995a4b 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -2185,11 +2185,11 @@ int hdparm_main(int argc, char **argv)
2185 argc -= optind; 2185 argc -= optind;
2186 argv += optind; 2186 argv += optind;
2187 2187
2188#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
2189 if (argc < 1) { 2188 if (argc < 1) {
2190 identify_from_stdin(); /* EXIT */ 2189 if (ENABLE_FEATURE_HDPARM_GET_IDENTITY && !isatty(STDIN_FILENO))
2190 identify_from_stdin(); /* EXIT */
2191 else bb_show_usage();
2191 } 2192 }
2192#endif
2193 2193
2194 while (argc--) { 2194 while (argc--) {
2195 process_dev(*argv); 2195 process_dev(*argv);