[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[linux-lvm] [Patch] lvchange better error reporting



Heinz, people,

It annoyed me that lvchange sometimes reported that volume group "(null)"
was invalid. This patch fixes this behaviour. Please apply.

diff -u -r 0.8final.orig/tools/lvchange.c 0.8final/tools/lvchange.c
--- 0.8final.orig/tools/lvchange.c	Tue Feb 22 03:09:33 2000
+++ 0.8final/tools/lvchange.c	Sat Apr 15 20:32:34 2000
@@ -255,9 +255,15 @@
       /* does VG exist? */
       if ( opt_v > 0) printf ( "%s -- checking volume group existence\n", cmd);
       if ( lvm_tab_vg_check_exist ( vg_name, NULL) != TRUE) {
-         fprintf ( stderr, "%s -- can't change logical volume: volume group "
-                           "\"%s\" doesn't exist\n\n", cmd, vg_name);
-         return LVM_ELVCHANGE_VG_CHECK_EXIST;
+        
+         if(vg_name)
+            fprintf ( stderr, "%s -- can't change logical volume: volume group "
+                 "\"%s\" doesn't exist\n\n", cmd, vg_name);
+         else
+            fprintf ( stderr, "%s -- can't change logical volume: need to specify "
+                              "volume group\n\n", cmd);
+                              
+         return LVM_ELVCHANGE_VG_CHECK_EXIST;
       }
 
       if ( opt_v > 0) printf ( "%s -- checking for active volume "

-- 
                       |              http://www.rent-a-nerd.nl
                       |                     - U N I X -
                       |          Inspice et cautus eris - D11T'95


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]