1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Changed how errors are detected, as returned by Write(), Read() and

Seek(). Seek() is particularly challenging because the value it
  returns might be a valid file position and not an error.

- Replaced numeric function return codes of 0 and -1 with macros OK,
  SEEK_ERROR/ERROR to clarify the respective purposes.

- Changed how ftell() and fseek() are used, double-checking the return
  value and the errno code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14923 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-04-24 09:53:12 +00:00
parent 1d611fefbe
commit 0c553faff1
12 changed files with 135 additions and 57 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fsetpos.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
* $Id: stdio_fsetpos.c,v 1.7 2005-04-24 09:53:12 obarthel Exp $
*
* :ts=4
*
@ -72,7 +72,7 @@ fsetpos(FILE *stream, fpos_t *pos)
}
#endif /* CHECK_FOR_NULL_POINTERS */
if(fseek(stream,(long int)(*pos),SEEK_SET) != 0)
if(fseek(stream,(long int)(*pos),SEEK_SET) == SEEK_ERROR && __get_errno() != OK)
{
SHOWMSG("fseek failed");
goto out;