diff options
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r-- | lib/libc/stdio/fdopen.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/fopen.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/fseek.c | 6 | ||||
-rw-r--r-- | lib/libc/stdio/makebuf.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/remove.c | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/lib/libc/stdio/fdopen.c b/lib/libc/stdio/fdopen.c index 8ba51eeab01..5ec625f739c 100644 --- a/lib/libc/stdio/fdopen.c +++ b/lib/libc/stdio/fdopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdopen.c,v 1.9 2016/03/20 00:01:21 krw Exp $ */ +/* $OpenBSD: fdopen.c,v 1.10 2019/06/28 13:32:42 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -55,7 +55,7 @@ fdopen(int fd, const char *mode) return (NULL); /* Make sure the mode the user wants is a subset of the actual mode. */ - if ((fdflags = fcntl(fd, F_GETFL)) < 0) + if ((fdflags = fcntl(fd, F_GETFL)) == -1) return (NULL); tmp = fdflags & O_ACCMODE; if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE))) { diff --git a/lib/libc/stdio/fopen.c b/lib/libc/stdio/fopen.c index 5932a552158..d62e2eb36d6 100644 --- a/lib/libc/stdio/fopen.c +++ b/lib/libc/stdio/fopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fopen.c,v 1.9 2016/09/21 04:38:56 guenther Exp $ */ +/* $OpenBSD: fopen.c,v 1.10 2019/06/28 13:32:42 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -51,7 +51,7 @@ fopen(const char *file, const char *mode) return (NULL); if ((fp = __sfp()) == NULL) return (NULL); - if ((f = open(file, oflags, DEFFILEMODE)) < 0) { + if ((f = open(file, oflags, DEFFILEMODE)) == -1) { fp->_flags = 0; /* release */ return (NULL); } diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c index f2e975df69e..1d0895a819a 100644 --- a/lib/libc/stdio/fseek.c +++ b/lib/libc/stdio/fseek.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fseek.c,v 1.12 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: fseek.c,v 1.13 2019/06/28 13:32:42 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -127,7 +127,7 @@ fseeko(FILE *fp, off_t offset, int whence) goto dumb; if ((fp->_flags & __SOPT) == 0) { if (seekfn != __sseek || - fp->_file < 0 || fstat(fp->_file, &st) || + fp->_file < 0 || fstat(fp->_file, &st) == -1 || (st.st_mode & S_IFMT) != S_IFREG) { fp->_flags |= __SNPT; goto dumb; @@ -143,7 +143,7 @@ fseeko(FILE *fp, off_t offset, int whence) if (whence == SEEK_SET) target = offset; else { - if (fstat(fp->_file, &st)) + if (fstat(fp->_file, &st) == -1) goto dumb; target = st.st_size + offset; } diff --git a/lib/libc/stdio/makebuf.c b/lib/libc/stdio/makebuf.c index 56e5f210cf4..b771a408779 100644 --- a/lib/libc/stdio/makebuf.c +++ b/lib/libc/stdio/makebuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: makebuf.c,v 1.9 2015/01/13 07:18:21 guenther Exp $ */ +/* $OpenBSD: makebuf.c,v 1.10 2019/06/28 13:32:42 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -81,7 +81,7 @@ __swhatbuf(FILE *fp, size_t *bufsize, int *couldbetty) { struct stat st; - if (fp->_file < 0 || fstat(fp->_file, &st) < 0) { + if (fp->_file < 0 || fstat(fp->_file, &st) == -1) { *couldbetty = 0; *bufsize = BUFSIZ; return (__SNPT); diff --git a/lib/libc/stdio/remove.c b/lib/libc/stdio/remove.c index e08e5997658..f3ad006376b 100644 --- a/lib/libc/stdio/remove.c +++ b/lib/libc/stdio/remove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: remove.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: remove.c,v 1.9 2019/06/28 13:32:42 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ remove(const char *file) { struct stat st; - if (lstat(file, &st) < 0) + if (lstat(file, &st) == -1) return (-1); if (S_ISDIR(st.st_mode)) return (rmdir(file)); |