Skip to content

Commit 02990f2

Browse files
committed
Change return type of readdir to *mut ::dirent
Apparently a lot of libc's don't put "const" on the return type for readdir, which causes type mismatch.
1 parent e010078 commit 02990f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ extern {
352352
pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
353353
#[cfg_attr(target_os = "macos", link_name = "readdir$INODE64")]
354354
#[cfg_attr(target_os = "netbsd", link_name = "__readdir30")]
355-
pub fn readdir(dirp: *mut ::DIR) -> *const ::dirent;
355+
pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
356356
#[cfg_attr(target_os = "macos", link_name = "readdir_r$INODE64")]
357357
#[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
358358
pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent,

0 commit comments

Comments
 (0)