Skip to content

Commit 8959ade

Browse files
committed
Change how the readdir/opendir hack works
1 parent ca406fa commit 8959ade

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/liblibc/lib.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3663,18 +3663,12 @@ pub mod funcs {
36633663
// opendir$INODE64, etc. but for some reason rustc
36643664
// doesn't link it correctly on i686, so we're going
36653665
// through a C function that mysteriously does work.
3666-
pub unsafe fn opendir(dirname: *c_char) -> *DIR {
3667-
rust_opendir(dirname)
3668-
}
3669-
pub unsafe fn readdir_r(dirp: *DIR,
3670-
entry: *mut dirent_t,
3671-
result: *mut *mut dirent_t) -> c_int {
3672-
rust_readdir_r(dirp, entry, result)
3673-
}
36743666

36753667
extern {
3676-
fn rust_opendir(dirname: *c_char) -> *DIR;
3677-
fn rust_readdir_r(dirp: *DIR, entry: *mut dirent_t,
3668+
#[link_name="rust_opendir"]
3669+
pub fn opendir(dirname: *c_char) -> *DIR;
3670+
#[link_name="rust_readdir_r"]
3671+
pub fn readdir_r(dirp: *DIR, entry: *mut dirent_t,
36783672
result: *mut *mut dirent_t) -> c_int;
36793673
}
36803674

@@ -4271,4 +4265,4 @@ pub mod funcs {
42714265
}
42724266
}
42734267

4274-
#[test] fn work_on_windows() { } // this is needed to make rustc happy on windows
4268+
#[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows

0 commit comments

Comments
 (0)