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/633961a8ffef
branches:  trunk
changeset: 345063:633961a8ffef
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 67cbf5179891 -r 633961a8ffef 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 67cbf5179891 -r 633961a8ffef 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