diff options
author | Karel Zak | 2013-05-13 15:40:57 +0200 |
---|---|---|
committer | Karel Zak | 2013-05-13 15:40:57 +0200 |
commit | 507341f83296f0e7786d8bfbb5d77a4de1666f3f (patch) | |
tree | 3a92443603b875bc7b4aaa7b6a7fbef131f71cb8 /lib | |
parent | standard SEE ALSO section of man pages (diff) | |
download | kernel-qcow2-util-linux-507341f83296f0e7786d8bfbb5d77a4de1666f3f.tar.gz kernel-qcow2-util-linux-507341f83296f0e7786d8bfbb5d77a4de1666f3f.tar.xz kernel-qcow2-util-linux-507341f83296f0e7786d8bfbb5d77a4de1666f3f.zip |
lib/tty: don't hardcode terminal fd in get_terminal_name()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ttyutils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ttyutils.c b/lib/ttyutils.c index 3b5a68cd8..76113a6d6 100644 --- a/lib/ttyutils.c +++ b/lib/ttyutils.c @@ -42,7 +42,8 @@ int get_terminal_width(void) return 0; } -int get_terminal_name(const char **path, +int get_terminal_name(int fd, + const char **path, const char **name, const char **number) { @@ -56,7 +57,7 @@ int get_terminal_name(const char **path, if (number) *number = NULL; - tty = ttyname(STDERR_FILENO); + tty = ttyname(fd); if (!tty) return -1; if (path) |