Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin More friendly error messages for modload(8) and modunlo...



details:   https://anonhg.NetBSD.org/src/rev/480f968e13c7
branches:  trunk
changeset: 815205:480f968e13c7
user:      khorben <khorben%NetBSD.org@localhost>
date:      Fri May 06 00:24:45 2016 +0000

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

Tested on NetBSD/amd64.

>From Christian Koch (cfkoch@) of EdgeBSD; thanks!

diffstat:

 sbin/modload/main.c   |  6 +++---
 sbin/modunload/main.c |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r c8c8d6083f2b -r 480f968e13c7 sbin/modload/main.c
--- a/sbin/modload/main.c       Thu May 05 21:14:14 2016 +0000
+++ b/sbin/modload/main.c       Fri May 06 00:24:45 2016 +0000
@@ -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 @@
                cmdargs.ml_propslen = strlen(propsstr);
 
                if (prog_modctl(MODCTL_LOAD, &cmdargs)) {
-                       err(EXIT_FAILURE, NULL);
+                       err(EXIT_FAILURE, "%s", cmdargs.ml_filename);
                }
        }
 
diff -r c8c8d6083f2b -r 480f968e13c7 sbin/modunload/main.c
--- a/sbin/modunload/main.c     Thu May 05 21:14:14 2016 +0000
+++ b/sbin/modunload/main.c     Fri May 06 00:24:45 2016 +0000
@@ -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 @@
 
        for (i = 1; i < argc; i++) {
                if (prog_modctl(MODCTL_UNLOAD, argv[i])) {
-                       err(EXIT_FAILURE, NULL);
+                       err(EXIT_FAILURE, "%s", argv[i]);
                }
        }
 



Home | Main Index | Thread Index | Old Index