projects
/
fw
/
pdclib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Addressed ticket #40 (non-standard errno values).
[fw/pdclib]
/
platform
/
example_cygwin
/
functions
/
_PDCLIB
/
flushbuffer.c
diff --git
a/platform/example_cygwin/functions/_PDCLIB/flushbuffer.c
b/platform/example_cygwin/functions/_PDCLIB/flushbuffer.c
index c2ac98d8ef8aac286460ede9a2e4aa8dcf326e7e..e68c6c49041875243d7e983211b682e0e4bbd28c 100644
(file)
--- a/
platform/example_cygwin/functions/_PDCLIB/flushbuffer.c
+++ b/
platform/example_cygwin/functions/_PDCLIB/flushbuffer.c
@@
-50,6
+50,10
@@
int _PDCLIB_flushbuffer( struct _PDCLIB_file_t * stream )
/* Write error */
switch ( errno )
{
/* Write error */
switch ( errno )
{
+ /* See <_PDCLIB_config.h>. There should be differenciated errno
+ handling here, possibly even a 1:1 mapping; but that is up
+ to the individual platform.
+ */
case EBADF:
case EFAULT:
case EFBIG:
case EBADF:
case EFAULT:
case EFBIG:
@@
-58,10
+62,11
@@
int _PDCLIB_flushbuffer( struct _PDCLIB_file_t * stream )
case EIO:
case ENOSPC:
case EPIPE:
case EIO:
case ENOSPC:
case EPIPE:
- _PDCLIB_errno = _PDCLIB_E
IO
;
+ _PDCLIB_errno = _PDCLIB_E
RROR
;
break;
default:
break;
default:
- _PDCLIB_errno = _PDCLIB_EUNKNOWN;
+ /* This should be something like EUNKNOWN. */
+ _PDCLIB_errno = _PDCLIB_ERROR;
break;
}
stream->status |= _PDCLIB_ERRORFLAG;
break;
}
stream->status |= _PDCLIB_ERRORFLAG;
@@
-79,7
+84,10
@@
int _PDCLIB_flushbuffer( struct _PDCLIB_file_t * stream )
return 0;
}
}
return 0;
}
}
- _PDCLIB_errno = _PDCLIB_ERETRY;
+ /* Number of retries exceeded. You probably want a different errno value
+ here.
+ */
+ _PDCLIB_errno = _PDCLIB_ERROR;
stream->status |= _PDCLIB_ERRORFLAG;
/* Move unwritten remains to begin of buffer. */
stream->bufidx -= written;
stream->status |= _PDCLIB_ERRORFLAG;
/* Move unwritten remains to begin of buffer. */
stream->bufidx -= written;