diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2001-09-01 12:13:33 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2001-09-01 12:13:33 +0000 |
| commit | 6ff604a73ac868eea3ce6cf8941dcf0447935b1d (patch) | |
| tree | 1f776d55eb2d0d79694823176aa4ea158a0c4c2b | |
| parent | 6946977c36c9db3d6b7c2cbbd281b2cc878471e9 (diff) | |
Notes
| -rw-r--r-- | lib/libc/stdio/ftell.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/libc/stdio/ftell.c b/lib/libc/stdio/ftell.c index 7784c672ab04..e355a202812c 100644 --- a/lib/libc/stdio/ftell.c +++ b/lib/libc/stdio/ftell.c @@ -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); } |
