[project @ 1998-08-11 19:24:33 by sof]
[ghc-hetmet.git] / ghc / lib / misc / cbits / readDescriptor.c
index 21714bf..bef2ec9 100644 (file)
@@ -20,12 +20,9 @@ readDescriptor(I_ fd, A_ buf, I_ nbytes)
       if (errno != EINTR) {
          cvtErrno();
          switch (ghc_errno) {
-         default:
-             stdErrno();
-             break;
          case GHC_EBADF:
                      ghc_errtype = ERR_INVALIDARGUMENT;
-              ghc_errstr  = "Not a valid write descriptor";
+              ghc_errstr  = "Not a valid read descriptor";
              break;
          case GHC_EBADMSG:
                      ghc_errtype = ERR_SYSTEMERROR;
@@ -33,7 +30,7 @@ readDescriptor(I_ fd, A_ buf, I_ nbytes)
              break;
          case GHC_EFAULT:
                      ghc_errtype = ERR_INVALIDARGUMENT;
-              ghc_errstr  = "Data buffer not in writeable part of user address space";
+              ghc_errstr  = "Data buffer not in readable part of user address space";
              break;
          case GHC_EINVAL:
              ghc_errtype = ERR_INVALIDARGUMENT;
@@ -41,7 +38,7 @@ readDescriptor(I_ fd, A_ buf, I_ nbytes)
              break;
          case GHC_EIO:
              ghc_errtype = ERR_SYSTEMERROR;
-             ghc_errstr  = "I/O error occurred while writing to file system";
+             ghc_errstr  = "I/O error occurred while reading";
              break;
          case GHC_EISDIR:
              ghc_errtype = ERR_INAPPROPRIATETYPE;
@@ -50,7 +47,10 @@ readDescriptor(I_ fd, A_ buf, I_ nbytes)
          case GHC_EAGAIN:
          case GHC_EWOULDBLOCK:
              ghc_errtype = ERR_OTHERERROR;
-             ghc_errstr  = "No data could be written immediately";
+             ghc_errstr  = "No data could be read immediately";
+             break;
+         default:
+             stdErrno();
              break;
          }
          return -1;