[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[linux-lvm] [PATCH] user check in lvmiopversion
- From: Claudio Matsuoka <claudio conectiva com>
- To: <linux-lvm sistina com>
- Subject: [linux-lvm] [PATCH] user check in lvmiopversion
- Date: Fri, 22 Dec 2000 18:21:40 -0500 (EST)
Quite trivial, but avoids misleading error messages like
[claudio pokey:/home/claudio] vgscan
lvmiopversion -- LVM driver/module not loaded?
vgscan: /lib/lvm-iop not found. Is lvm-iop installed?
when running a wrapped tool. Also a test for the return value != 0 is
needed in the wrapper script:
IOP=`/sbin/lvmiopversion`
ret=$?
if [ $ret -ne 0 ]; then
exit $ret
fi
---8<-----
--- lvmiopversion.c-orig Fri Dec 22 18:06:14 2000
+++ lvmiopversion.c Fri Dec 22 18:05:57 2000
@@ -19,6 +19,12 @@
* Boston, MA 02111-1307, USA.
*/
+/*
+ * Changelog
+ *
+ * 22/12/2000 - added SUSER_CHECK to avoid complaints about module
+ * not loaded. --claudio
+ */
#include <stdio.h>
#include <lvm_user.h>
@@ -31,6 +37,8 @@
int main(int argc, char *argv[])
{
int ver = lvm_get_iop_version();
+
+ SUSER_CHECK;
if (ver < 0) {
fprintf(stderr, "%s -- LVM driver/module not loaded?\n\n", cmd);
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]