aboutsummaryrefslogtreecommitdiffstats
path: root/src/logging.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/logging.c')
-rw-r--r--src/logging.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/logging.c b/src/logging.c
index 01732ca..86cf7c3 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -46,7 +46,6 @@
#endif /*!HAVE_W32_SYSTEM*/
#include <unistd.h>
#include <fcntl.h>
-#include <assert.h>
/* #include <execinfo.h> */
#define _GPGRT_NEED_AFLOCAL 1
@@ -690,7 +689,11 @@ _gpgrt_log_get_stream ()
{
/* Make sure a log stream has been set. */
_gpgrt_log_set_sink (NULL, NULL, -1);
- assert (logstream);
+ if (!logstream)
+ {
+ fputs ("gpgrt fatal: failed to init log stream\n", stderr);
+ _gpgrt_abort ();
+ }
}
return logstream;
}
@@ -902,7 +905,11 @@ _gpgrt_logv_internal (int level, int ignore_arg_ptr, const char *extrastring,
/* Make sure a log stream has been set. */
_gpgrt_log_set_sink (NULL, NULL, -1);
#endif
- assert (logstream);
+ if (!logstream)
+ {
+ fputs ("gpgrt fatal: failed to init log stream\n", stderr);
+ _gpgrt_abort ();
+ }
}
_gpgrt_flockfile (logstream);
@@ -1038,7 +1045,7 @@ _gpgrt_logv_internal (int level, int ignore_arg_ptr, const char *extrastring,
/* for (btidx=0; btidx < btlen; btidx++) */
/* log_debug ("[%d] %s\n", btidx, btstr[btidx]); */
/* } */
- abort ();
+ _gpgrt_abort ();
}
else
_gpgrt_funlockfile (logstream);
@@ -1136,7 +1143,7 @@ _gpgrt_log_fatal (const char *fmt, ...)
va_start (arg_ptr, fmt);
_gpgrt_logv_internal (GPGRT_LOGLVL_FATAL, 0, NULL, NULL, fmt, arg_ptr);
va_end (arg_ptr);
- abort (); /* Never called; just to make the compiler happy. */
+ _gpgrt_abort (); /* Never called; just to make the compiler happy. */
}
@@ -1148,7 +1155,7 @@ _gpgrt_log_bug (const char *fmt, ...)
va_start (arg_ptr, fmt);
_gpgrt_logv_internal (GPGRT_LOGLVL_BUG, 0, NULL, NULL, fmt, arg_ptr);
va_end (arg_ptr);
- abort (); /* Never called; just to make the compiler happy. */
+ _gpgrt_abort (); /* Never called; just to make the compiler happy. */
}
@@ -1331,5 +1338,5 @@ _gpgrt__log_assert (const char *expr, const char *file,
_gpgrt_log (GPGRT_LOGLVL_BUG, "Assertion \"%s\" failed (%s:%d)\n",
expr, file, line);
#endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
- abort (); /* Never called; just to make the compiler happy. */
+ _gpgrt_abort (); /* Never called; just to make the compiler happy. */
}