summary refs log tree commit diff
path: root/src/libstd/path.rs
diff options
context:
space:
mode:
authorYoung-il Choi <duddlf.choi@samsung.com>2013-06-17 18:53:33 +0900
committerYoung-il Choi <duddlf.choi@samsung.com>2013-06-17 18:53:33 +0900
commitb82370cec65b17456b1d5b98a283d3f46a8ab09a (patch)
tree6730aa4fadfeed25dbfec0d3f386b15744ea0bce /src/libstd/path.rs
parentc4c7e0fb6689f606ec74d9cc29c8e0f7c71fd51c (diff)
downloadrust-b82370cec65b17456b1d5b98a283d3f46a8ab09a.tar.gz
rust-b82370cec65b17456b1d5b98a283d3f46a8ab09a.zip
std: fix stat struct of android (SEGV error from run-pass/stat.rs on android)
Diffstat (limited to 'src/libstd/path.rs')
-rw-r--r--src/libstd/path.rs30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 9c4e8f08358..b1f0ffdae65 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -128,7 +128,6 @@ pub trait GenericPath {
 #[cfg(target_os = "android")]
 mod stat {
     #[cfg(target_arch = "x86")]
-    #[cfg(target_arch = "arm")]
     pub mod arch {
         use libc;
 
@@ -158,6 +157,35 @@ mod stat {
         }
     }
 
+    #[cfg(target_arch = "arm")]
+    pub mod arch {
+        use libc;
+
+        pub fn default_stat() -> libc::stat {
+            libc::stat {
+                st_dev: 0,
+                __pad0: [0, ..4],
+                __st_ino: 0,
+                st_mode: 0,
+                st_nlink: 0,
+                st_uid: 0,
+                st_gid: 0,
+                st_rdev: 0,
+                __pad3: [0, ..4],
+                st_size: 0,
+                st_blksize: 0,
+                st_blocks: 0,
+                st_atime: 0,
+                st_atime_nsec: 0,
+                st_mtime: 0,
+                st_mtime_nsec: 0,
+                st_ctime: 0,
+                st_ctime_nsec: 0,
+                st_ino: 0
+            }
+        }
+    }
+
     #[cfg(target_arch = "mips")]
     pub mod arch {
         use libc;