From e4ed2fda1c845e534a9af839e248e015722cae8a Mon Sep 17 00:00:00 2001 From: Milos Jakubicek Date: Thu, 14 May 2009 00:55:41 +0200 Subject: [PATCH] more user-friendly error message Hi folks, we recently had a bug filed against the nbd Fedora package claiming about the clarity of the error message which is printed when the nbd module is not loaded: https://bugzilla.redhat.com/show_bug.cgi?id=496751 What about merging a tiny patch I attached? Regards, Milos --- nbd-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbd-client.c b/nbd-client.c index 4156915..eba063f 100644 --- a/nbd-client.c +++ b/nbd-client.c @@ -232,7 +232,7 @@ int main(int argc, char *argv[]) { if (strcmp(argv[0], "-d")==0) { nbd = open(argv[1], O_RDWR); if (nbd < 0) - err("Can not open NBD: %m"); + err("Cannot open NBD: %m\nPlease ensure the 'nbd' module is loaded."); printf("Disconnecting: que, "); if (ioctl(nbd, NBD_CLEAR_QUE)< 0) err("Ioctl failed: %m\n"); @@ -276,7 +276,7 @@ int main(int argc, char *argv[]) { nbddev = argv[0]; nbd = open(nbddev, O_RDWR); if (nbd < 0) - err("Can not open NBD: %m"); + err("Cannot open NBD: %m\nPlease ensure the 'nbd' module is loaded."); ++argv; --argc; /* skip device */ if (argc>3) goto errmsg; -- 1.7.10.4