summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/logging.c
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-06-21 02:00:23 -0700
committerHarshavardhana <harsha@harshavardhana.net>2014-07-02 17:20:34 -0700
commit1b74cf992986287a510fe3b28a8ee7554e8b0992 (patch)
treea5fad911274080947f5874b4d90cc4f67b6f4473 /libglusterfs/src/logging.c
parente4a3566681acbadfe0f7bd879443116885ada4eb (diff)
porting: Port for FreeBSD rebased from Mike Ma's efforts
- Provides a working Gluster Management Daemon, CLI - Provides a working GlusterFS server, GlusterNFS server - Provides a working GlusterFS client - execinfo port from FreeBSD is moved into ./contrib/libexecinfo for ease of portability on NetBSD. (FreeBSD 10 and OSX provide execinfo natively) - More portability cleanups for Darwin, FreeBSD and NetBSD - Provides a new rc script for FreeBSD Change-Id: I8dff336f97479ca5a7f9b8c6b730051c0f8ac46f BUG: 1111774 Original-Author: Mike Ma <mikemandarine@gmail.com> Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8141 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'libglusterfs/src/logging.c')
-rw-r--r--libglusterfs/src/logging.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index b3626538b96..e9734bcfca1 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -25,6 +25,8 @@
#ifdef HAVE_BACKTRACE
#include <execinfo.h>
+#else
+#include "execinfo_compat.h"
#endif
#include <sys/stat.h>
@@ -814,8 +816,6 @@ _gf_log_callingfn (const char *domain, const char *file, const char *function,
else
basename = file;
-#if HAVE_BACKTRACE
- /* Print 'calling function' */
do {
void *array[5];
char **callingfn = NULL;
@@ -838,7 +838,6 @@ _gf_log_callingfn (const char *domain, const char *file, const char *function,
free (callingfn);
} while (0);
-#endif /* HAVE_BACKTRACE */
if (ctx->log.log_control_file_found)
{
@@ -1070,7 +1069,6 @@ out:
return ret;
}
-#if HAVE_BACKTRACE
void
_gf_msg_backtrace_nomem (gf_loglevel_t level, int stacksize)
{
@@ -1105,7 +1103,8 @@ _gf_msg_backtrace_nomem (gf_loglevel_t level, int stacksize)
fileno (stderr);
if (bt_size && (fd != -1)) {
/* print to the file fd, to prevent any
- * allocations from backtrace_symbols */
+ allocations from backtrace_symbols
+ */
backtrace_symbols_fd (&array[0], bt_size, fd);
}
}
@@ -1153,7 +1152,6 @@ out:
FREE (callingfn);
return ret;
}
-#endif /* HAVE_BACKTRACE */
int
_gf_msg_nomem (const char *domain, const char *file,
@@ -1261,9 +1259,7 @@ _gf_msg_nomem (const char *domain, const char *file,
}
pthread_mutex_unlock (&ctx->log.logfile_mutex);
-#ifdef HAVE_BACKTRACE
_gf_msg_backtrace_nomem (level, GF_LOG_BACKTRACE_DEPTH);
-#endif
break;
}
@@ -2035,7 +2031,6 @@ _gf_msg (const char *domain, const char *file, const char *function,
if (level > ctx->log.loglevel)
goto out;
-#if HAVE_BACKTRACE
if (trace) {
ret = _gf_msg_backtrace (GF_LOG_BACKTRACE_DEPTH, callstr,
GF_LOG_BACKTRACE_DEPTH);
@@ -2044,7 +2039,6 @@ _gf_msg (const char *domain, const char *file, const char *function,
else
ret = 0;
}
-#endif /* HAVE_BACKTRACE */
pthread_mutex_lock (&ctx->log.logfile_mutex);
{