version 1.14, 2015/11/09 16:39:13 |
version 1.15, 2015/11/09 16:42:35 |
|
|
*/ |
*/ |
if (!(ch_flags & CH_CANSEEK)) |
if (!(ch_flags & CH_CANSEEK)) |
return ('?'); |
return ('?'); |
if (lseek(ch_file, (off_t)pos, SEEK_SET) == BAD_LSEEK) { |
if (lseek(ch_file, (off_t)pos, SEEK_SET) == (off_t)-1) { |
error("seek error", NULL); |
error("seek error", NULL); |
clear_eol(); |
clear_eol(); |
return (EOI); |
return (EOI); |
|
|
} |
} |
#endif |
#endif |
|
|
if (lseek(ch_file, (off_t)0, SEEK_SET) == BAD_LSEEK) { |
if (lseek(ch_file, (off_t)0, SEEK_SET) == (off_t)-1) { |
/* |
/* |
* Warning only; even if the seek fails for some reason, |
* Warning only; even if the seek fails for some reason, |
* there's a good chance we're at the beginning anyway. |
* there's a good chance we're at the beginning anyway. |
|
|
int |
int |
seekable(int f) |
seekable(int f) |
{ |
{ |
return (lseek(f, (off_t)1, SEEK_SET) != BAD_LSEEK); |
return (lseek(f, (off_t)1, SEEK_SET) != (off_t)-1); |
} |
} |
|
|
/* |
/* |