afs: Indicate error from afs_osi_Read/Write better
[openafs.git] / src / afs / AIX / osi_file.c
index 37df330..7ecaaf2 100644 (file)
@@ -164,7 +164,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
@@ -198,7 +198,9 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
            goto retry_IO;
        }
        setuerror(code);
-       code = -1;
+       if (code > 0) {
+           code *= -1;
+       }
     }
     return code;
 }
@@ -241,7 +243,9 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
            afs_warnuser
                ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
        setuerror(code);
-       code = -1;
+       if (code > 0) {
+           code *= -1;
+       }
     }
     if (afile->proc) {
        (*afile->proc) (afile, code);