- }
- messages = backtrace_symbols(trace, trace_size);
- for (i=1; i<trace_size; ++i) {
- st = sdscat(st,messages[i]);
- st = sdscatlen(st,"\n",1);
- }
- zlibc_free(messages);
- return st;
+
+ /* Write symbols to log file */
+ backtrace_symbols_fd(trace, trace_size, fd);
+
+ /* Cleanup */
+ if (server.logfile) close(fd);