summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>1999-03-14 04:06:00 +0000
committergrog <grog@FreeBSD.org>1999-03-14 04:06:00 +0000
commit8ee15b4e69a8a977e1e87f43a5c0620c6cc73724 (patch)
tree4dbdefcfb48f39a4908dd75ca95b89cef2b9e0fd /sbin
parentf3472fd7dc45cb3cee3e1029f2ec50c972adc6bd (diff)
downloadFreeBSD-src-8ee15b4e69a8a977e1e87f43a5c0620c6cc73724.zip
FreeBSD-src-8ee15b4e69a8a977e1e87f43a5c0620c6cc73724.tar.gz
create command: get the message right if an error occurs with a
non-verbose create.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/vinum/commands.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/vinum/commands.c b/sbin/vinum/commands.c
index bb7ed8f..2611f17 100644
--- a/sbin/vinum/commands.c
+++ b/sbin/vinum/commands.c
@@ -69,6 +69,7 @@ vinum_create(int argc, char *argv[], char *arg0[])
int error;
FILE *dfd; /* file descriptor for the config file */
char buffer[BUFSIZE]; /* read config file in here */
+ char commandline[BUFSIZE]; /* issue command from here */
struct _ioctl_reply *reply;
int ioctltype; /* for ioctl call */
@@ -100,11 +101,12 @@ vinum_create(int argc, char *argv[], char *arg0[])
}
file_line++; /* count the lines */
if (verbose)
- printf("%4d: %s", file_line, buffer); /* XXX */
- ioctl(superdev, VINUM_CREATE, &buffer);
+ printf("%4d: %s", file_line, buffer);
+ strcpy(commandline, buffer); /* make a copy */
+ ioctl(superdev, VINUM_CREATE, buffer);
if (reply->error != 0) { /* error in config */
if (!verbose) /* print this line anyway */
- printf("%4d: %s", file_line, buffer);
+ printf("%4d: %s", file_line, commandline);
fprintf(stdout, "** %d %s: %s\n", file_line, reply->msg, strerror(reply->error));
/* XXX at the moment, we reset the config
* lock on error, so try to get it again.
OpenPOWER on IntegriCloud