From 53cc2ebaea5e5488d5285f0d13ffa47069ee986f 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. Change-Id: Ie4adbbd98f5006a9aa50ed9bf73ea9e4344fabf3 Reviewed-on: http://gerrit.openafs.org/5000 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 e55a5a2..28e0ac9 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -14,6 +14,8 @@ #include +#pragma GCC diagnostic warning "-Wunused-but-set-variable" + #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 -- 1.9.4