summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-05-06 13:18:00 +0000
committerJim Meyering <jim@meyering.net>2000-05-06 13:18:00 +0000
commitc141f3a34e6aadd8d8338a530ffcea30629a01bd (patch)
tree3d7df5116da220d3bdbf44f1983e6d9099fa24b3 /src
parent3140984fab615a5d694cc0fdbb1fe02b243b42ad (diff)
downloadcoreutils-c141f3a34e6aadd8d8338a530ffcea30629a01bd.tar.xz
(main): Warn about arguments, don't fail.
(usage): Call close_stdout_status from here as well as from main.
Diffstat (limited to 'src')
-rw-r--r--src/tty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tty.c b/src/tty.c
index f1c4310bc..04fce48e8 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -1,5 +1,5 @@
/* tty -- print the path of the terminal connected to standard input
- Copyright (C) 1990-1999 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -69,6 +69,7 @@ Print the file name of the terminal connected to standard input.\n\
"));
puts (_("\nReport bugs to <bug-sh-utils@gnu.org>."));
}
+ close_stdout_status (3);
exit (status);
}
@@ -106,7 +107,7 @@ main (int argc, char **argv)
}
if (optind != argc)
- usage (2);
+ error (0, 0, _("ignoring all arguments"));
tty = ttyname (0);
if (!silent)