Skip to content

Commit

Permalink
dir: Cast RENAME_EXCHANGE back to libc::c_int
Browse files Browse the repository at this point in the history
Workaround tailhook#35
AKA rust-lang/libc#2116

Unfortunately since we made this libc::c_int in our
public API, we can't easily change it right now.

Closes: tailhook#35
  • Loading branch information
cgwalters committed Mar 19, 2021
1 parent eab8f97 commit 42f87fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,14 @@ impl Dir {
pub fn local_exchange<P: AsPath, R: AsPath>(&self, old: P, new: R)
-> io::Result<()>
{
// Workaround https://github.com/tailhook/openat/issues/35
// AKA https://github.com/rust-lang/libc/pull/2116
// Unfortunately since we made this libc::c_int in our
// public API, we can't easily change it right now.
let flags = libc::RENAME_EXCHANGE as libc::c_int;
rename_flags(self, to_cstr(old)?.as_ref(),
self, to_cstr(new)?.as_ref(),
libc::RENAME_EXCHANGE)
flags)
}

/// Remove a subdirectory in this directory
Expand Down

0 comments on commit 42f87fa

Please sign in to comment.