about summary refs log tree commit diff
path: root/src/libstd/rt/backtrace.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/rt/backtrace.rs')
-rw-r--r--src/libstd/rt/backtrace.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs
index d075f9a1205..00477f8e119 100644
--- a/src/libstd/rt/backtrace.rs
+++ b/src/libstd/rt/backtrace.rs
@@ -464,11 +464,15 @@ mod imp {
         // the symbols. The libbacktrace API also states that the filename must
         // be in "permanent memory", so we copy it to a static and then use the
         // static as the pointer.
+        //
+        // FIXME: We also call self_exe_name() on DragonFly BSD. I haven't 
+        //        tested if this is required or not.
         unsafe fn init_state() -> *mut backtrace_state {
             static mut STATE: *mut backtrace_state = 0 as *mut backtrace_state;
             static mut LAST_FILENAME: [libc::c_char, ..256] = [0, ..256];
             if !STATE.is_null() { return STATE }
-            let selfname = if cfg!(target_os = "freebsd") {
+            let selfname = if cfg!(target_os = "freebsd") || 
+                              cfg!(target_os = "dragonfly") {
                 os::self_exe_name()
             } else {
                 None