From 456ee898ae77b201275363f4efc0098c28e195d5 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 22 Dec 2011 14:50:09 -0500 Subject: [PATCH] afs: afs_osi_Read/Write returns negative on error afs_osi_Read and afs_osi_Write need to return negative values on error. EIO is not negative; return -EIO so we don't accidentally return "success" if someone requested to read or write EIO bytes. Change-Id: Id0693776737fdf7086de16a935ad3942f5026e55 Reviewed-on: http://gerrit.openafs.org/6411 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/afs/AIX/osi_file.c | 2 +- src/afs/DARWIN/osi_file.c | 2 +- src/afs/FBSD/osi_file.c | 2 +- src/afs/HPUX/osi_file.c | 2 +- src/afs/IRIX/osi_file.c | 2 +- src/afs/LINUX/osi_file.c | 4 ++-- src/afs/LINUX24/osi_file.c | 4 ++-- src/afs/NBSD/osi_file.c | 2 +- src/afs/OBSD/osi_file.c | 2 +- src/afs/SOLARIS/osi_file.c | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/afs/AIX/osi_file.c b/src/afs/AIX/osi_file.c index 37df3302b..0efcbaba1 100644 --- a/src/afs/AIX/osi_file.c +++ b/src/afs/AIX/osi_file.c @@ -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) diff --git a/src/afs/DARWIN/osi_file.c b/src/afs/DARWIN/osi_file.c index 4012ff733..bbecfd4f4 100644 --- a/src/afs/DARWIN/osi_file.c +++ b/src/afs/DARWIN/osi_file.c @@ -321,7 +321,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) diff --git a/src/afs/FBSD/osi_file.c b/src/afs/FBSD/osi_file.c index 02fe2536f..484c63303 100644 --- a/src/afs/FBSD/osi_file.c +++ b/src/afs/FBSD/osi_file.c @@ -170,7 +170,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) diff --git a/src/afs/HPUX/osi_file.c b/src/afs/HPUX/osi_file.c index 1bba21f8d..2afe1da6e 100644 --- a/src/afs/HPUX/osi_file.c +++ b/src/afs/HPUX/osi_file.c @@ -150,7 +150,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) diff --git a/src/afs/IRIX/osi_file.c b/src/afs/IRIX/osi_file.c index 1800d759e..f351910c8 100644 --- a/src/afs/IRIX/osi_file.c +++ b/src/afs/IRIX/osi_file.c @@ -144,7 +144,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) diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index 843ce7a8b..72f020c00 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -215,7 +215,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) @@ -250,7 +250,7 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr, if (!afs_shuttingdown) osi_Panic("afs_osi_Write called with null param"); else - return EIO; + return -EIO; } if (offset != -1) diff --git a/src/afs/LINUX24/osi_file.c b/src/afs/LINUX24/osi_file.c index 875138808..b01be67dd 100644 --- a/src/afs/LINUX24/osi_file.c +++ b/src/afs/LINUX24/osi_file.c @@ -200,7 +200,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) @@ -235,7 +235,7 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr, if (!afs_shuttingdown) osi_Panic("afs_osi_Write called with null param"); else - return EIO; + return -EIO; } if (offset != -1) diff --git a/src/afs/NBSD/osi_file.c b/src/afs/NBSD/osi_file.c index d162f6e4f..e5ef6816b 100644 --- a/src/afs/NBSD/osi_file.c +++ b/src/afs/NBSD/osi_file.c @@ -157,7 +157,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr, afs_int32 asize) if (!afs_shuttingdown) osi_Panic("osi_Read called with null param"); else - return EIO; + return -EIO; } if (offset != -1) diff --git a/src/afs/OBSD/osi_file.c b/src/afs/OBSD/osi_file.c index a82cd02b8..e9921988c 100644 --- a/src/afs/OBSD/osi_file.c +++ b/src/afs/OBSD/osi_file.c @@ -146,7 +146,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr, afs_int32 asize) if (!afs_shuttingdown) osi_Panic("osi_Read called with null param"); else - return EIO; + return -EIO; } if (offset != -1) diff --git a/src/afs/SOLARIS/osi_file.c b/src/afs/SOLARIS/osi_file.c index 8f92cc8ca..f06661811 100644 --- a/src/afs/SOLARIS/osi_file.c +++ b/src/afs/SOLARIS/osi_file.c @@ -364,7 +364,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) -- 2.39.5