-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I was just skimming this code and noticed we were incorrectly using `write`. I'd like to reopen that conversation about using cap-std and especially cap-std-ext, which would have fixed several of these bugs with our nice high level helper API like https://docs.rs/cap-std-ext/latest/cap_std_ext/dirext/trait.CapStdExtDirExt.html#tymethod.atomic_replace_with Anyways for now I just fixed the implementation here. - Add a doc comment - Add O_CLOEXEC - Use `write_all` instead of a single `write` (!) - Add a test (Also a different bug, this function takes a `Stat` but ignores everything except st_mode, but we can fix that later) Signed-off-by: Colin Walters <[email protected]>
- Loading branch information
1 parent
873b82d
commit 55ae2e9
Showing
1 changed file
with
45 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters