From 4843369f20d437a01f43a6a94ec58fb0a4b7ff3e Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 13 Jul 2011 14:33:57 +0100 Subject: [PATCH] volser: Actually return errors from ListOneVolume The return code from GetVolInfo was being thrown away, and success returned to the caller, regardless of the success of this function. As GetVolInfo's exit codes aren't suitable for sending over the wire, just return ENODEV if this function returns failure. (cherry picked from commit 53cc2ebaea5e5488d5285f0d13ffa47069ee986f) Reviewed-on: http://gerrit.openafs.org/5000 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear Change-Id: I72e82d014ea2320a095bb4a3281449d250a52d3b Reviewed-on: http://gerrit.openafs.org/5006 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/volser/volprocs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 469272ed7..5c9cebd9d 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -12,6 +12,7 @@ #include #include +#pragma GCC diagnostic warning "-Wunused-but-set-variable" #include #include @@ -29,6 +30,7 @@ #include #include + #include #include #include @@ -2388,7 +2390,10 @@ VolListOneVolume(struct rx_call *acid, afs_int32 partid, } closedir(dirp); - return (found) ? 0 : ENODEV; + if (found) + return code ? ENODEV: 0; + else + return ENODEV; } /*------------------------------------------------------------------------ @@ -2519,7 +2524,10 @@ VolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID, * return the proper value. */ closedir(dirp); - return (found) ? 0 : ENODEV; + if (found) + return code ? ENODEV: 0; + else + return ENODEV; } /*SAFSVolXListOneVolume */ /*returns all the volumes on partition partid. If flags = 1 then all the -- 2.39.5