stdio/fread.c \
stdio/snprintf.c\
stdio/sprintf.c \
+ stdio/stdio.c \
stdio/stdio_ext.cpp \
# Fortify implementations of libc functions.
upstream-openbsd/lib/libc/stdio/setbuffer.c \
upstream-openbsd/lib/libc/stdio/setvbuf.c \
upstream-openbsd/lib/libc/stdio/sscanf.c \
- upstream-openbsd/lib/libc/stdio/stdio.c \
upstream-openbsd/lib/libc/stdio/swprintf.c \
upstream-openbsd/lib/libc/stdio/swscanf.c \
upstream-openbsd/lib/libc/stdio/tempnam.c \
* SUCH DAMAGE.
*/
+#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
FILE *fp = cookie;
int ret;
- ret = read(fp->_file, buf, n);
+ ret = TEMP_FAILURE_RETRY(read(fp->_file, buf, n));
/* if the read succeeded, update the current offset */
if (ret >= 0)
fp->_offset += ret;
FILE *fp = cookie;
if (fp->_flags & __SAPP)
- (void) lseek(fp->_file, (off_t)0, SEEK_END);
+ (void) TEMP_FAILURE_RETRY(lseek(fp->_file, (off_t)0, SEEK_END));
fp->_flags &= ~__SOFF; /* in case FAPPEND mode is set */
- return (write(fp->_file, buf, n));
+ return TEMP_FAILURE_RETRY(write(fp->_file, buf, n));
}
fpos_t
FILE *fp = cookie;
off_t ret;
- ret = lseek(fp->_file, (off_t)offset, whence);
+ ret = TEMP_FAILURE_RETRY(lseek(fp->_file, (off_t)offset, whence));
if (ret == (off_t)-1)
fp->_flags &= ~__SOFF;
else {
int
__sclose(void *cookie)
{
- return (close(((FILE *)cookie)->_file));
+ return TEMP_FAILURE_RETRY(close(((FILE *)cookie)->_file));
}