Skip to content

Commit 1e03020

Browse files
committed
---
yaml --- r: 274970 b: refs/heads/stable c: 8f2d7d9 h: refs/heads/master
1 parent 516c73f commit 1e03020

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: dcdfed49d7414a44bb3cfe73cf62ad2881055230
32+
refs/heads/stable: 8f2d7d956ce54e77e98472f4d80e24fdf662560e
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/libstd/sys/unix/fs.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use os::unix::prelude::*;
1515
use ffi::{CString, CStr, OsString, OsStr};
1616
use fmt;
1717
use io::{self, Error, ErrorKind, SeekFrom};
18-
use libc::{self, dirent, c_int, mode_t};
18+
use libc::{self, c_int, mode_t};
1919
use mem;
2020
use path::{Path, PathBuf};
2121
use ptr;
@@ -26,10 +26,12 @@ use sys::{cvt, cvt_r};
2626
use sys_common::{AsInner, FromInner};
2727

2828
#[cfg(target_os = "linux")]
29-
use libc::{stat64, fstat64, lstat64, off64_t, ftruncate64, lseek64};
29+
use libc::{stat64, fstat64, lstat64, off64_t, ftruncate64, lseek64, dirent64, readdir64_r};
3030
#[cfg(not(target_os = "linux"))]
3131
use libc::{stat as stat64, fstat as fstat64, lstat as lstat64, off_t as off64_t,
32-
ftruncate as ftruncate64, lseek as lseek64};
32+
ftruncate as ftruncate64, lseek as lseek64, dirent as dirent64};
33+
#[cfg(not(any(target_os = "linux", target_os = "solaris")))]
34+
use libc::{readdir_r as readdir64_r};
3335

3436
pub struct File(FileDesc);
3537

@@ -49,7 +51,7 @@ unsafe impl Send for Dir {}
4951
unsafe impl Sync for Dir {}
5052

5153
pub struct DirEntry {
52-
entry: dirent,
54+
entry: dirent64,
5355
root: Arc<PathBuf>,
5456
// We need to store an owned copy of the directory name
5557
// on Solaris because a) it uses a zero-length array to
@@ -224,7 +226,7 @@ impl Iterator for ReadDir {
224226
};
225227
let mut entry_ptr = ptr::null_mut();
226228
loop {
227-
if libc::readdir_r(self.dirp.0, &mut ret.entry, &mut entry_ptr) != 0 {
229+
if readdir64_r(self.dirp.0, &mut ret.entry, &mut entry_ptr) != 0 {
228230
return Some(Err(Error::last_os_error()))
229231
}
230232
if entry_ptr.is_null() {

0 commit comments

Comments
 (0)