Skip to content

Commit 06ad5eb

Browse files
emberianalexcrichton
authored andcommitted
Change how the readdir/opendir hack works
1 parent 308c035 commit 06ad5eb

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/liblibc/lib.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -3695,18 +3695,12 @@ pub mod funcs {
36953695
// opendir$INODE64, etc. but for some reason rustc
36963696
// doesn't link it correctly on i686, so we're going
36973697
// through a C function that mysteriously does work.
3698-
pub unsafe fn opendir(dirname: *c_char) -> *DIR {
3699-
rust_opendir(dirname)
3700-
}
3701-
pub unsafe fn readdir_r(dirp: *DIR,
3702-
entry: *mut dirent_t,
3703-
result: *mut *mut dirent_t) -> c_int {
3704-
rust_readdir_r(dirp, entry, result)
3705-
}
37063698

37073699
extern {
3708-
fn rust_opendir(dirname: *c_char) -> *DIR;
3709-
fn rust_readdir_r(dirp: *DIR, entry: *mut dirent_t,
3700+
#[link_name="rust_opendir"]
3701+
pub fn opendir(dirname: *c_char) -> *DIR;
3702+
#[link_name="rust_readdir_r"]
3703+
pub fn readdir_r(dirp: *DIR, entry: *mut dirent_t,
37103704
result: *mut *mut dirent_t) -> c_int;
37113705
}
37123706

@@ -4321,3 +4315,5 @@ pub mod funcs {
43214315
}
43224316
}
43234317
}
4318+
4319+
#[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows

0 commit comments

Comments
 (0)