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 Not all systems sport err.h, so redo ...
details: https://anonhg.NetBSD.org/src/rev/de779cb4e444
branches: trunk
changeset: 789858:de779cb4e444
user: pooka <pooka%NetBSD.org@localhost>
date: Tue Sep 10 20:36:08 2013 +0000
description:
Not all systems sport err.h, so redo those bits using the die() routine
we need to have hanging around anyway for proper error reporting from
a daemonizing server. le sigh
diffstat:
usr.bin/rump_allserver/rump_allserver.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diffs (72 lines):
diff -r 528cdb7a52a6 -r de779cb4e444 usr.bin/rump_allserver/rump_allserver.c
--- a/usr.bin/rump_allserver/rump_allserver.c Tue Sep 10 19:42:32 2013 +0000
+++ b/usr.bin/rump_allserver/rump_allserver.c Tue Sep 10 20:36:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_allserver.c,v 1.25 2013/09/10 19:42:32 pooka Exp $ */
+/* $NetBSD: rump_allserver.c,v 1.26 2013/09/10 20:36:08 pooka 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.25 2013/09/10 19:42:32 pooka Exp $");
+__RCSID("$NetBSD: rump_allserver.c,v 1.26 2013/09/10 20:36:08 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@@ -44,7 +44,6 @@
#endif
#include <dlfcn.h>
-#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <semaphore.h>
@@ -73,7 +72,7 @@
die(int sflag, int error, const char *reason)
{
- warnx("%s: %s", reason, strerror(error));
+ fprintf(stderr, "%s: %s", reason, strerror(error));
if (!sflag)
rump_daemonize_done(error);
exit(1);
@@ -283,7 +282,7 @@
if (netfs - curetfs == 0) {
etfs = realloc(etfs, (netfs+16)*sizeof(*etfs));
if (etfs == NULL)
- err(1, "realloc etfs");
+ die(1, errno, "realloc etfs");
netfs += 16;
}
@@ -304,8 +303,7 @@
snprintf(pb, sizeof(pb), "lib%s.so", optarg);
if (dlopen(pb, RTLD_LAZY|RTLD_GLOBAL) == NULL) {
- errx(1, "dlopen %s failed: %s",
- pb, dlerror());
+ die(1, 0, "dlopen lib");
}
}
break;
@@ -316,7 +314,7 @@
modarray = realloc(modarray,
(nmods+16) * sizeof(char *));
if (modarray == NULL)
- err(1, "realloc");
+ die(1, errno, "realloc");
nmods += 16;
}
modarray[curmod++] = optarg;
@@ -348,7 +346,7 @@
if (!sflag) {
error = rump_daemonize_begin();
if (error)
- errx(1, "rump daemonize: %s", strerror(error));
+ die(1, error, "rump daemonize");
}
error = rump_init();
Home |
Main Index |
Thread Index |
Old Index