]> git.sur5r.net Git - cc65/commitdiff
Made use of the new common __directerrno and __mappederrno function.
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 17 Jul 2010 19:13:07 +0000 (19:13 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 17 Jul 2010 19:13:07 +0000 (19:13 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4749 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/apple2/opendir.c

index ad415705aa783cbad9ca55b3661ec639f01a4808..98fd4a348be95634fc82c006ad2d00bc2b2951b7 100644 (file)
@@ -65,7 +65,7 @@ DIR* __fastcall__ opendir (register const char* name)
     if ((dir = malloc (sizeof (*dir))) == NULL) {
 
        /* May not have been done by malloc() */
-       errno = ENOMEM;
+       _directerrno (ENOMEM);
 
        /* Return failure */
        return NULL;
@@ -96,8 +96,8 @@ DIR* __fastcall__ opendir (register const char* name)
        }
 
        /* EOF: Most probably no directory file at all */
-       if (errno == 0) {
-           errno = EINVAL;
+       if (_oserror == 0) {
+           _directerrno (EINVAL);
        }
 
        /* Cleanup directory file */