summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/svc/configd/configd.h13
-rw-r--r--usr/src/cmd/svc/startd/startd.h15
-rw-r--r--usr/src/cmd/svc/svcadm/svcadm.c15
-rw-r--r--usr/src/cmd/svc/svccfg/svccfg.h13
-rw-r--r--usr/src/cmd/svc/svcs/explain.c12
-rw-r--r--usr/src/lib/libuutil/common/libuutil.h3
-rw-r--r--usr/src/lib/libuutil/common/libuutil_impl.h10
-rw-r--r--usr/src/lib/libuutil/common/mapfile-vers2
8 files changed, 30 insertions, 53 deletions
diff --git a/usr/src/cmd/svc/configd/configd.h b/usr/src/cmd/svc/configd/configd.h
index ff2b450619..4ab5567556 100644
--- a/usr/src/cmd/svc/configd/configd.h
+++ b/usr/src/cmd/svc/configd/configd.h
@@ -24,6 +24,10 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
+ */
+
#ifndef _CONFIGD_H
#define _CONFIGD_H
@@ -88,14 +92,9 @@ extern "C" {
#define CONFIGD_CORE "core.%f.%t.%p"
-#ifndef NDEBUG
#define bad_error(f, e) \
- uu_warn("%s:%d: %s() returned bad error %d. Aborting.\n", \
- __FILE__, __LINE__, f, e); \
- abort()
-#else
-#define bad_error(f, e) abort()
-#endif
+ uu_panic("%s:%d: %s() returned bad error %d. Aborting.\n", \
+ __FILE__, __LINE__, f, e);
typedef enum backend_type {
BACKEND_TYPE_NORMAL = 0,
diff --git a/usr/src/cmd/svc/startd/startd.h b/usr/src/cmd/svc/startd/startd.h
index c1062e45e0..d230ed1490 100644
--- a/usr/src/cmd/svc/startd/startd.h
+++ b/usr/src/cmd/svc/startd/startd.h
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
*/
#ifndef _STARTD_H
@@ -82,16 +82,9 @@ extern "C" {
#endif
-#ifndef NDEBUG
-#define bad_error(func, err) { \
- (void) fprintf(stderr, "%s:%d: %s() failed with unexpected " \
- "error %d. Aborting.\n", __FILE__, __LINE__, (func), (err)); \
- abort(); \
-}
-#else
-#define bad_error(func, err) abort()
-#endif
-
+#define bad_error(func, err) \
+ uu_panic("%s:%d: %s() failed with unexpected " \
+ "error %d. Aborting.\n", __FILE__, __LINE__, (func), (err));
#define min(a, b) (((a) < (b)) ? (a) : (b))
diff --git a/usr/src/cmd/svc/svcadm/svcadm.c b/usr/src/cmd/svc/svcadm/svcadm.c
index 7cd61454c9..ac698930d4 100644
--- a/usr/src/cmd/svc/svcadm/svcadm.c
+++ b/usr/src/cmd/svc/svcadm/svcadm.c
@@ -24,7 +24,7 @@
*/
/*
- * Copyright 2013, Joyent, Inc. All rights reserved.
+ * Copyright 2015, Joyent, Inc. All rights reserved.
*/
/*
@@ -71,16 +71,9 @@
*/
#define WAIT_INTERVAL 3
-#ifndef NDEBUG
-#define bad_error(func, err) { \
- pr_warn("%s:%d: %s() failed with unexpected error %d.\n", \
- __FILE__, __LINE__, (func), (err)); \
- abort(); \
-}
-#else
-#define bad_error(func, err) abort()
-#endif
-
+#define bad_error(func, err) \
+ uu_panic("%s:%d: %s() failed with unexpected error %d.\n", \
+ __FILE__, __LINE__, (func), (err));
struct ht_elt {
struct ht_elt *next;
diff --git a/usr/src/cmd/svc/svccfg/svccfg.h b/usr/src/cmd/svc/svccfg/svccfg.h
index 135d12bf33..9fdfba3221 100644
--- a/usr/src/cmd/svc/svccfg/svccfg.h
+++ b/usr/src/cmd/svc/svccfg/svccfg.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
*/
#ifndef _CMD_SVCCFG_H
@@ -319,15 +320,9 @@ typedef struct scf_callback {
*/
typedef struct tmpl_errors tmpl_errors_t;
-#ifndef NDEBUG
-#define bad_error(func, err) { \
- (void) fprintf(stderr, "%s:%d: %s() failed with unexpected " \
- "error %d. Aborting.\n", __FILE__, __LINE__, (func), (err)); \
- abort(); \
-}
-#else
-#define bad_error(func, err) abort()
-#endif
+#define bad_error(func, err) \
+ uu_panic("%s:%d: %s() failed with unexpected " \
+ "error %d. Aborting.\n", __FILE__, __LINE__, (func), (err));
#define SC_CMD_LINE 0x0
#define SC_CMD_FILE 0x1
diff --git a/usr/src/cmd/svc/svcs/explain.c b/usr/src/cmd/svc/svcs/explain.c
index 42fca80172..533437cbee 100644
--- a/usr/src/cmd/svc/svcs/explain.c
+++ b/usr/src/cmd/svc/svcs/explain.c
@@ -22,7 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
*/
/*
@@ -112,15 +112,9 @@
#define uu_list_append(lst, e) uu_list_insert_before(lst, NULL, e)
-#ifdef NDEBUG
-#define bad_error(func, err) abort()
-#else
#define bad_error(func, err) \
- (void) fprintf(stderr, "%s:%d: %s() failed with unknown error %d.\n", \
- __FILE__, __LINE__, func, err); \
- abort();
-#endif
-
+ uu_panic("%s:%d: %s() failed with unknown error %d.\n", \
+ __FILE__, __LINE__, func, err);
typedef struct {
const char *svcname;
diff --git a/usr/src/lib/libuutil/common/libuutil.h b/usr/src/lib/libuutil/common/libuutil.h
index 6675424466..ec1bf907c1 100644
--- a/usr/src/lib/libuutil/common/libuutil.h
+++ b/usr/src/lib/libuutil/common/libuutil.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBUUTIL_H
@@ -90,6 +91,8 @@ extern void uu_vdie(const char *, va_list) __NORETURN;
/*PRINTFLIKE2*/
extern void uu_xdie(int, const char *, ...) __NORETURN;
extern void uu_vxdie(int, const char *, va_list) __NORETURN;
+/*PRINTFLIKE1*/
+extern void uu_panic(const char *, ...) __NORETURN;
/*
* Exit status functions (not to be used directly)
diff --git a/usr/src/lib/libuutil/common/libuutil_impl.h b/usr/src/lib/libuutil/common/libuutil_impl.h
index 9466e59745..6b73e0f72d 100644
--- a/usr/src/lib/libuutil/common/libuutil_impl.h
+++ b/usr/src/lib/libuutil/common/libuutil_impl.h
@@ -24,11 +24,13 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
+ */
+
#ifndef _LIBUUTIL_IMPL_H
#define _LIBUUTIL_IMPL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <libuutil.h>
#include <pthread.h>
@@ -42,10 +44,6 @@ extern "C" {
void uu_set_error(uint_t);
#pragma rarely_called(uu_set_error)
-/*PRINTFLIKE1*/
-void uu_panic(const char *format, ...);
-#pragma rarely_called(uu_panic)
-
struct uu_dprintf {
char *uud_name;
uu_dprintf_severity_t uud_severity;
diff --git a/usr/src/lib/libuutil/common/mapfile-vers b/usr/src/lib/libuutil/common/mapfile-vers
index 75295894b6..c9d740bc8d 100644
--- a/usr/src/lib/libuutil/common/mapfile-vers
+++ b/usr/src/lib/libuutil/common/mapfile-vers
@@ -20,6 +20,7 @@
#
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, Joyent, Inc. All rights reserved.
#
#
@@ -101,6 +102,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
uu_memdup;
uu_msprintf;
uu_open_tmp;
+ uu_panic;
uu_setpname;
uu_strbw;
uu_strcaseeq;