Module Name: src Committed By: khorben Date: Fri May 6 00:24:45 UTC 2016
Modified Files: src/sbin/modload: main.c src/sbin/modunload: main.c Log Message: More friendly error messages for modload(8) and modunload(8) Tested on NetBSD/amd64. >From Christian Koch (cfkoch@) of EdgeBSD; thanks! To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sbin/modload/main.c cvs rdiff -u -r1.4 -r1.5 src/sbin/modunload/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.15 src/sbin/modload/main.c:1.16 --- src/sbin/modload/main.c:1.15 Thu Feb 7 12:04:01 2013 +++ src/sbin/modload/main.c Fri May 6 00:24:45 2016 @@ -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); } } Index: src/sbin/modunload/main.c diff -u src/sbin/modunload/main.c:1.4 src/sbin/modunload/main.c:1.5 --- src/sbin/modunload/main.c:1.4 Mon Dec 13 20:48:45 2010 +++ src/sbin/modunload/main.c Fri May 6 00:24:45 2016 @@ -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]); } }