Implement special read function that sets errno in case of a short read. Drop

_dirskip in favour of the new function.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5672 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-06-03 13:59:31 +00:00
parent 9d0a2c3007
commit a83bf3dc04
5 changed files with 91 additions and 79 deletions

View File

@@ -13,7 +13,8 @@
DIR* __fastcall__ opendir (const char*)
{
{
unsigned char buf[32];
DIR* dir = 0;
DIR d;
@@ -27,7 +28,7 @@ DIR* __fastcall__ opendir (const char*)
if (d.fd >= 0) {
/* Skip the disk header */
if (_dirskip (32, &d)) {
if (_dirread (&d, buf, 32)) {
/* Allocate memory for the DIR structure returned */
dir = malloc (sizeof (*dir));