]> pd.if.org Git - pdclib.old/blobdiff - platform/example_cygwin/functions/_PDCLIB/open.c
Addressed ticket #40 (non-standard errno values).
[pdclib.old] / platform / example_cygwin / functions / _PDCLIB / open.c
index 88af3c4e86d2dfef69d9ca97025253c9e6a69c4e..4e7d2b979369b6d000d946907efe3f9bf862a53a 100644 (file)
@@ -66,6 +66,9 @@ int _PDCLIB_open( char const * const filename, unsigned int mode )
     {
         switch ( errno )
         {
+            /* See the comments on implementation-defined errno values in
+               <_PDCLIB_config.h>.
+            */
             case EACCES:
             case EFAULT:
             case EINTR:
@@ -82,9 +85,12 @@ int _PDCLIB_open( char const * const filename, unsigned int mode )
             case EOVERFLOW:
             case EROFS:
             case ETXTBSY:
-                _PDCLIB_errno = _PDCLIB_EIO;
+                _PDCLIB_errno = _PDCLIB_ERROR;
+                break;
             default:
-                _PDCLIB_errno = _PDCLIB_EUNKNOWN;
+                /* This should be something like EUNKNOWN. */
+                _PDCLIB_errno = _PDCLIB_ERROR;
+                break;
         }
     }
     return rc;