diff options
author | Rob Landley | 2006-06-07 21:22:42 +0000 |
---|---|---|
committer | Rob Landley | 2006-06-07 21:22:42 +0000 |
commit | 6d8ce170b0be743f761244f467cdaa5f4318638d (patch) | |
tree | 9eb1bcdc6c73b7512c3611911275f28d06ec94c5 /miscutils/hdparm.c | |
parent | 5929edc1fac4340f99ed84e92bf3a2bedd4177c2 (diff) | |
download | busybox-6d8ce170b0be743f761244f467cdaa5f4318638d.zip busybox-6d8ce170b0be743f761244f467cdaa5f4318638d.tar.gz |
Fix from Tito to read from stdin only when it's not a tty.
Diffstat (limited to 'miscutils/hdparm.c')
-rw-r--r-- | miscutils/hdparm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index 5703ece..512995a 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c @@ -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); |