From 59f3d6ae123851da79e77b4c85f842aac413ccf8 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Fri, 6 May 2016 23:27:17 +0100 Subject: write: remove pointless fileno(3) calls Signed-off-by: Sami Kerola --- term-utils/write.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'term-utils/write.c') diff --git a/term-utils/write.c b/term-utils/write.c index b8bd08eca..03af66050 100644 --- a/term-utils/write.c +++ b/term-utils/write.c @@ -312,12 +312,12 @@ int main(int argc, char **argv) } /* check that sender has write enabled */ - if (isatty(fileno(stdin))) - myttyfd = fileno(stdin); - else if (isatty(fileno(stdout))) - myttyfd = fileno(stdout); - else if (isatty(fileno(stderr))) - myttyfd = fileno(stderr); + if (isatty(STDIN_FILENO)) + myttyfd = STDIN_FILENO; + else if (isatty(STDOUT_FILENO)) + myttyfd = STDOUT_FILENO; + else if (isatty(STDERR_FILENO)) + myttyfd = STDERR_FILENO; else myttyfd = -1; -- cgit v1.2.3-55-g7522