summaryrefslogtreecommitdiffstats
path: root/bin/stty
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2011-05-03 10:08:11 +0000
committerru <ru@FreeBSD.org>2011-05-03 10:08:11 +0000
commita1d4dd2a37566f73a3a51b3286c7f7b8169b10e3 (patch)
treeed1517ef26994f5799942e4f89d6956c25c3024a /bin/stty
parente262422a37aa8c99aafdd14921424e64ffa2d3fe (diff)
downloadFreeBSD-src-a1d4dd2a37566f73a3a51b3286c7f7b8169b10e3.zip
FreeBSD-src-a1d4dd2a37566f73a3a51b3286c7f7b8169b10e3.tar.gz
Don't call -f option's argument "stdin".
MFC after: 3 days
Diffstat (limited to 'bin/stty')
-rw-r--r--bin/stty/stty.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/stty/stty.c b/bin/stty/stty.c
index f6daaf0..b70f49f 100644
--- a/bin/stty/stty.c
+++ b/bin/stty/stty.c
@@ -61,9 +61,11 @@ main(int argc, char *argv[])
struct info i;
enum FMT fmt;
int ch;
+ const char *file;
fmt = NOTSET;
i.fd = STDIN_FILENO;
+ file = "stdin";
opterr = 0;
while (optind < argc &&
@@ -79,6 +81,7 @@ main(int argc, char *argv[])
case 'f':
if ((i.fd = open(optarg, O_RDONLY | O_NONBLOCK)) < 0)
err(1, "%s", optarg);
+ file = optarg;
break;
case 'g':
fmt = GFLAG;
@@ -92,7 +95,7 @@ args: argc -= optind;
argv += optind;
if (tcgetattr(i.fd, &i.t) < 0)
- errx(1, "stdin isn't a terminal");
+ errx(1, "%s isn't a terminal", file);
if (ioctl(i.fd, TIOCGETD, &i.ldisc) < 0)
err(1, "TIOCGETD");
if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0)
OpenPOWER on IntegriCloud