Print backtrace to standard error

This commit is contained in:
Silvan Calarco 2013-05-29 12:15:00 +02:00
parent 628ae59139
commit 6524044cb9

View File

@ -205,10 +205,10 @@ void backtraceHandler(int sig)
size = backtrace (array, 10);
strings = (char**)backtrace_symbols (array, size);
printf ("Obtained %zd stack frames.\n", size);
fprintf(stderr, "Obtained %zd stack frames.\n", size);
for (i = 0; i < size; i++)
printf ("%s\n", strings[i]);
fprintf(stderr, "%s\n", strings[i]);
free (strings);
exit(1);