Skip to content

Commit e142032

Browse files
authored
Merge pull request #36 from cgwalters/libc-rename-signed
dir: Cast RENAME_EXCHANGE back to libc::c_int
2 parents eab8f97 + 42f87fa commit e142032

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/dir.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,14 @@ impl Dir {
366366
pub fn local_exchange<P: AsPath, R: AsPath>(&self, old: P, new: R)
367367
-> io::Result<()>
368368
{
369+
// Workaround https://github.com/tailhook/openat/issues/35
370+
// AKA https://github.com/rust-lang/libc/pull/2116
371+
// Unfortunately since we made this libc::c_int in our
372+
// public API, we can't easily change it right now.
373+
let flags = libc::RENAME_EXCHANGE as libc::c_int;
369374
rename_flags(self, to_cstr(old)?.as_ref(),
370375
self, to_cstr(new)?.as_ref(),
371-
libc::RENAME_EXCHANGE)
376+
flags)
372377
}
373378

374379
/// Remove a subdirectory in this directory

0 commit comments

Comments
 (0)