More friendly error messages for modload(8) and modunload(8)

Tested on NetBSD/amd64.

From Christian Koch (cfkoch@) of EdgeBSD; thanks!
This commit is contained in:
khorben 2016-05-06 00:24:45 +00:00
parent 9f696726de
commit 3df9a0e8ab
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.15 2013/02/07 12:04:01 apb Exp $ */
/* $NetBSD: main.c,v 1.16 2016/05/06 00:24:45 khorben Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: main.c,v 1.15 2013/02/07 12:04:01 apb Exp $");
__RCSID("$NetBSD: main.c,v 1.16 2016/05/06 00:24:45 khorben Exp $");
#endif /* !lint */
#include <sys/module.h>
@ -170,7 +170,7 @@ main(int argc, char **argv)
cmdargs.ml_propslen = strlen(propsstr);
if (prog_modctl(MODCTL_LOAD, &cmdargs)) {
err(EXIT_FAILURE, NULL);
err(EXIT_FAILURE, "%s", cmdargs.ml_filename);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.4 2010/12/13 20:48:45 pooka Exp $ */
/* $NetBSD: main.c,v 1.5 2016/05/06 00:24:45 khorben Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: main.c,v 1.4 2010/12/13 20:48:45 pooka Exp $");
__RCSID("$NetBSD: main.c,v 1.5 2016/05/06 00:24:45 khorben Exp $");
#endif /* !lint */
#include <sys/module.h>
@ -57,7 +57,7 @@ main(int argc, char **argv)
for (i = 1; i < argc; i++) {
if (prog_modctl(MODCTL_UNLOAD, argv[i])) {
err(EXIT_FAILURE, NULL);
err(EXIT_FAILURE, "%s", argv[i]);
}
}