summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/stdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/stdio.c')
-rw-r--r--lib/libc/stdio/stdio.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c
index a4a27b53b64..fe28f00918c 100644
--- a/lib/libc/stdio/stdio.c
+++ b/lib/libc/stdio/stdio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdio.c,v 1.9 2005/08/08 08:05:36 espie Exp $ */
+/* $OpenBSD: stdio.c,v 1.10 2016/09/21 04:38:56 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -31,9 +31,8 @@
* SUCH DAMAGE.
*/
-#include <fcntl.h>
-#include <unistd.h>
#include <stdio.h>
+#include <unistd.h>
#include "local.h"
/*
@@ -61,7 +60,7 @@ __swrite(void *cookie, const char *buf, int n)
FILE *fp = cookie;
if (fp->_flags & __SAPP)
- (void) lseek(fp->_file, (off_t)0, SEEK_END);
+ (void) lseek(fp->_file, 0, SEEK_END);
fp->_flags &= ~__SOFF; /* in case FAPPEND mode is set */
return (write(fp->_file, buf, n));
}
@@ -72,8 +71,8 @@ __sseek(void *cookie, fpos_t offset, int whence)
FILE *fp = cookie;
off_t ret;
- ret = lseek(fp->_file, (off_t)offset, whence);
- if (ret == (off_t)-1)
+ ret = lseek(fp->_file, offset, whence);
+ if (ret == -1)
fp->_flags &= ~__SOFF;
else {
fp->_flags |= __SOFF;