immediatelly as old code does, now for append modes too.
Real use case for such fallback is impossible (unless specially crafted).
2) Remove now unneded include I forgot to remove in prev. commits.
MFC after: 1 week
#include "namespace.h"
#include <sys/types.h>
#include <errno.h>
-#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include "un-namespace.h"
if (!(fp->_flags & __SRD) && (fp->_flags & __SWR) &&
fp->_p != NULL && fp->_p - fp->_bf._base > 0 &&
((fp->_flags & __SAPP) || (fp->_flags2 & __S2OAP))) {
- if ((pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) {
- if (errno == ESPIPE ||
- (fp->_flags & __SOPT) || __sflush(fp) ||
- (pos = _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1)
- return (1);
- else {
- *offset = pos;
- return (0);
- }
- }
+ pos = _sseek(fp, (fpos_t)0, SEEK_END);
+ if (pos == -1)
+ return (1);
} else if (fp->_flags & __SOFF)
pos = fp->_offset;
else {