summaryrefslogtreecommitdiffstats
path: root/libdimension/platform.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-14 21:20:43 -0500
committerTavian Barnes <tavianator@gmail.com>2010-11-14 21:20:43 -0500
commit8fe33a340b8979a73fa84f201c15519a9b5d0266 (patch)
tree12cdbb1c1b9a48f533ab36980602785be1e1deeb /libdimension/platform.c
parent20a55aa78050d94b187d4edfaac91ea00efea505 (diff)
downloaddimension-8fe33a340b8979a73fa84f201c15519a9b5d0266.tar.xz
Document libdimension with Doxygen.
Diffstat (limited to 'libdimension/platform.c')
-rw-r--r--libdimension/platform.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libdimension/platform.c b/libdimension/platform.c
index 0317bd5..9ae579a 100644
--- a/libdimension/platform.c
+++ b/libdimension/platform.c
@@ -18,6 +18,11 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
+/**
+ * @file
+ * Platform abstractions.
+ */
+
#include "dimension-impl.h"
#if HAVE_UNISTD_H
#include <unistd.h>
@@ -40,7 +45,10 @@ dmnsn_backtrace(FILE *file)
void *buffer[size];
int nptrs = backtrace(buffer, size);
- backtrace_symbols_fd(buffer, nptrs, fileno(file));
+ int fd = fileno(file);
+ if (fd != -1) {
+ backtrace_symbols_fd(buffer, nptrs, fd);
+ }
#endif
}