From: Sami Kerola Date: Fri, 6 May 2016 22:27:17 +0000 (+0100) Subject: write: remove pointless fileno(3) calls X-Git-Tag: v2.29-rc1~152^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59f3d6ae123851da79e77b4c85f842aac413ccf8;p=thirdparty%2Futil-linux.git write: remove pointless fileno(3) calls Signed-off-by: Sami Kerola --- diff --git a/term-utils/write.c b/term-utils/write.c index b8bd08eca8..03af660501 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;