diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-08-17 21:12:18 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-08-17 21:12:18 +0400 |
commit | 22d82f9f46f2edd819a1b328883a7330ca7e1508 (patch) | |
tree | c5d0128f88c1bc60335bb24c980eebf8b60085e0 /winsup/cygwin/fhandler_raw.cc | |
parent | 293ce8104da2b49fde7682913264339df7b70cd4 (diff) |
* errno.cc (errmap): Map ERROR_INVALID_BLOCK_LENGTH to EIO.
* fhandler_raw.cc (fhandler_dev_raw::raw_read): Set more accurate
errnos instead of EACCES.
(fhandler_dev_raw::raw_write): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_raw.cc')
-rw-r--r-- | winsup/cygwin/fhandler_raw.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler_raw.cc b/winsup/cygwin/fhandler_raw.cc index ebd8ef0cc..42f84073d 100644 --- a/winsup/cygwin/fhandler_raw.cc +++ b/winsup/cygwin/fhandler_raw.cc @@ -202,7 +202,10 @@ fhandler_dev_raw::raw_read (void *ptr, size_t& ulen) ret = writebuf (); if (ret) { - set_errno (is_eom (ret) ? ENOSPC : EACCES); + if (is_eom (ret)) + set_errno (ENOSPC); + else + __seterrno (); goto err; } @@ -267,8 +270,7 @@ fhandler_dev_raw::raw_read (void *ptr, size_t& ulen) { if (!is_eof (ret) && !is_eom (ret)) { - debug_printf ("return -1, set errno to EACCES"); - set_errno (EACCES); + __seterrno (); goto err; } @@ -309,8 +311,7 @@ fhandler_dev_raw::raw_read (void *ptr, size_t& ulen) { if (!is_eof (ret) && !is_eom (ret)) { - debug_printf ("return -1, set errno to EACCES"); - set_errno (EACCES); + __seterrno (); goto err; } if (bytes_read) @@ -442,7 +443,7 @@ fhandler_dev_raw::raw_write (const void *ptr, size_t len) has_written = 1; if (!is_eom (ret)) { - set_errno (EACCES); + __seterrno (); return -1; } eom_detected = 1; |