Fix description of function, and invocation of lseek.
Signed-off-by: Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
gcc/algol68/ChangeLog
* a68-parser-scanner.cc (a68_file_size): Fix comment to mention
it accepts `FILE *' and not file descriptor.
Fix invocation of `lseek' to correctly revert position of file
offset to previous one.
} \
while (0)
-/* Get the size of a file given a file descriptor FILE. In case the size of
+/* Get the size of a file given a stream pointer FILE. In case the size of
the file cannot be determined then this function returns -1. */
ssize_t
return -1;
fsize = (ssize_t) off;
- off = lseek (fileno (file), 0, save);
+ off = lseek (fileno (file), save, SEEK_SET);
if (off == (off_t) -1)
return -1;