mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-01 17:12:46 +00:00
Strict in the POSIX sence, if file position is unspecified after ungetc() at
0, return that we can't specify it, i.e. error with ESPIPE. (hint from: "Peter S. Housel" <housel@acm.org>) Back out sinit() addition, not needed after various code simplifications.
This commit is contained in:
parent
6946977c36
commit
6ff604a73a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82736
@ -78,17 +78,15 @@ ftello(fp)
|
||||
fpos_t rv;
|
||||
int ret;
|
||||
|
||||
/* make sure stdio is set up */
|
||||
if (!__sdidinit)
|
||||
__sinit();
|
||||
|
||||
FLOCKFILE(fp);
|
||||
ret = _ftello(fp, &rv);
|
||||
FUNLOCKFILE(fp);
|
||||
if (ret)
|
||||
return (-1);
|
||||
if (rv < 0) /* Unspecified value because of ungetc() at 0 */
|
||||
rv = 0;
|
||||
if (rv < 0) { /* Unspecified value because of ungetc() at 0 */
|
||||
errno = ESPIPE;
|
||||
return (-1);
|
||||
}
|
||||
return (rv);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user