From e37b0cbef8b7cc598fdb5f9e858856971f4d2985 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 17 May 2015 01:56:02 +0000 Subject: [PATCH] Of course, fcntl errno case returns -1, which must be converted to 0 with guenther --- lib/libc/gen/isatty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/isatty.c b/lib/libc/gen/isatty.c index 3b63f2575c4..c0b543698db 100644 --- a/lib/libc/gen/isatty.c +++ b/lib/libc/gen/isatty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isatty.c,v 1.9 2015/05/17 01:22:01 deraadt Exp $ */ +/* $OpenBSD: isatty.c,v 1.10 2015/05/17 01:56:02 deraadt Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -33,5 +33,5 @@ int isatty(int fd) { - return (fcntl(fd, F_ISATTY)); + return fcntl(fd, F_ISATTY) != -1; } -- 2.20.1