Skip to content

Commit 4060b4e

Browse files
committed
Use libc's F_GETPATH
1 parent 712b698 commit 4060b4e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@ impl FilePath for File {
5050
fn path(&self) -> io::Result<PathBuf> {
5151
use std::ffi::OsString;
5252
use std::os::unix::ffi::OsStringExt;
53-
const F_GETPATH: i32 = 50;
5453

5554
let fd = self.as_raw_fd();
5655
let mut path = vec![0; libc::PATH_MAX as usize + 1];
5756

5857
unsafe {
59-
if libc::fcntl(fd, F_GETPATH, path.as_mut_ptr()) < 0 {
58+
if libc::fcntl(fd, libc::F_GETPATH, path.as_mut_ptr()) < 0 {
6059
return Err(io::Error::last_os_error());
6160
}
6261
}

0 commit comments

Comments
 (0)