Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/rump_allserver Don't hold back, tell us how you real...



details:   https://anonhg.NetBSD.org/src/rev/5f9727c91d56
branches:  trunk
changeset: 325290:5f9727c91d56
user:      bad <bad%NetBSD.org@localhost>
date:      Mon Dec 16 23:27:33 2013 +0000

description:
Don't hold back, tell us how you really feel when dlopen() fails.

diffstat:

 usr.bin/rump_allserver/rump_allserver.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r c9541a922663 -r 5f9727c91d56 usr.bin/rump_allserver/rump_allserver.c
--- a/usr.bin/rump_allserver/rump_allserver.c   Mon Dec 16 23:25:56 2013 +0000
+++ b/usr.bin/rump_allserver/rump_allserver.c   Mon Dec 16 23:27:33 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_allserver.c,v 1.28 2013/11/13 17:47:27 pooka Exp $        */
+/*     $NetBSD: rump_allserver.c,v 1.29 2013/12/16 23:27:33 bad Exp $  */
 
 /*-
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 #include <rump/rumpuser_port.h>
 
 #ifndef lint
-__RCSID("$NetBSD: rump_allserver.c,v 1.28 2013/11/13 17:47:27 pooka Exp $");
+__RCSID("$NetBSD: rump_allserver.c,v 1.29 2013/12/16 23:27:33 bad Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -65,7 +65,11 @@
 die(int sflag, int error, const char *reason)
 {
 
-       fprintf(stderr, "%s: %s", reason, strerror(error));
+       if (reason != NULL)
+               fputs(reason, stderr);
+       if (error > 0)
+               fprintf(stderr, ": %s", strerror(error));
+       fputc('\n', stderr);
        if (!sflag)
                rump_daemonize_done(error);
        exit(1);
@@ -295,7 +299,8 @@
 
                                snprintf(pb, sizeof(pb), "lib%s.so", optarg);
                                if (dlopen(pb, RTLD_LAZY|RTLD_GLOBAL) == NULL) {
-                                       die(1, 0, "dlopen lib");
+                                       fprintf(stderr, "dlopen: %s", dlerror());
+                                       die(1, 0, NULL);
                                }
                        }
                        break;



Home | Main Index | Thread Index | Old Index