From: deraadt Date: Sun, 17 May 2015 01:56:02 +0000 (+0000) Subject: Of course, fcntl errno case returns -1, which must be converted to 0 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e37b0cbef8b7cc598fdb5f9e858856971f4d2985;p=openbsd Of course, fcntl errno case returns -1, which must be converted to 0 with guenther --- 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; }