]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
volser: Actually return errors from ListOneVolume
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Wed, 13 Jul 2011 13:33:57 +0000 (14:33 +0100)
committerDerrick Brashear <shadow@dementia.org>
Thu, 14 Jul 2011 05:48:47 +0000 (22:48 -0700)
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 <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I72e82d014ea2320a095bb4a3281449d250a52d3b
Reviewed-on: http://gerrit.openafs.org/5006
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/volser/volprocs.c

index 469272ed7edc6b4400cf7aeb1e44cb9b4514da0c..5c9cebd9dbc0123796ff81a6b18afac762866b0c 100644 (file)
@@ -12,6 +12,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#pragma  GCC diagnostic warning "-Wunused-but-set-variable"
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -29,6 +30,7 @@
 
 #include <dirent.h>
 #include <sys/stat.h>
+
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rxkad.h>
@@ -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