summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
diff options
context:
space:
mode:
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-11-24 12:18:04 +0200
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-11-24 17:12:01 +0200
commitc6577473df7117b7a6e030605df1e28cd0e55708 (patch)
tree11063c8a2f723869a8da2b7640c5b1fbdfba20ec /lib/igt_core.c
parent2a1c1c099113022f091f9e9585be88c6c9cefec5 (diff)
lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
write_stderr() and __write_stderr() are defined behind ifdef on HAVE_LIBUNWIND, but do no depend on the lib in any way. fatal_sig_handler() uses those helpers unconditionally. This patch just moves the code couple of lines up, so the helpers are always available and do not break build on systems without libunwind. Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r--lib/igt_core.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 4fe48c97..6ce83bec 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1231,6 +1231,16 @@ static bool run_under_gdb(void)
strncmp(basename(buf), "gdb", 3) == 0);
}
+static void __write_stderr(const char *str, size_t len)
+{
+ igt_ignore_warn(write(STDERR_FILENO, str, len));
+}
+
+static void write_stderr(const char *str)
+{
+ __write_stderr(str, strlen(str));
+}
+
#ifdef HAVE_LIBUNWIND
#define UNW_LOCAL_ONLY
#include <libunwind.h>
@@ -1407,16 +1417,6 @@ xprintf(const char *fmt, ...)
va_end(ap);
}
-static void __write_stderr(const char *str, size_t len)
-{
- igt_ignore_warn(write(STDERR_FILENO, str, len));
-}
-
-static void write_stderr(const char *str)
-{
- __write_stderr(str, strlen(str));
-}
-
static void print_backtrace_sig_safe(void)
{
unw_cursor_t cursor;