How did this ever work? Fix to pass fileno(fp), instead of fp to lseek.
Pass off_t instead of fpos_t as the second argument.
This commit is contained in:
parent
8212c7a241
commit
93bfa94d10
|
@ -36,7 +36,7 @@
|
|||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
/*static char *sccsid = "from: @(#)ftell.c 5.4 (Berkeley) 2/5/91";*/
|
||||
static char *rcsid = "$Id: ftell.c,v 1.1 1994/02/07 22:06:01 proven Exp $";
|
||||
static char *rcsid = "$Id: ftell.c,v 1.2 1997/10/08 04:12:34 christos Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <pthread.h>
|
||||
|
@ -62,7 +62,7 @@ ftell(fp)
|
|||
if (fp->_flags & __SOFF)
|
||||
pos = fp->_offset;
|
||||
else {
|
||||
pos = lseek(fp, (fpos_t)0, SEEK_CUR);
|
||||
pos = lseek(fileno(fp), (off_t)0, SEEK_CUR);
|
||||
}
|
||||
|
||||
if (pos != -1L) {
|
||||
|
|
Loading…
Reference in New Issue