-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement mkfifoat #1133
Implement mkfifoat #1133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start, but don't forget to add a CHANGELOG.
test/test_unistd.rs
Outdated
|
||
let stats = stat::stat(&mkfifoat_fifo).unwrap(); | ||
let typ = stat::SFlag::from_bits_truncate(stats.st_mode); | ||
assert!(typ == SFlag::S_IFIFO); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be assert_eq
instead, here and elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
let typ = stat::SFlag::from_bits_truncate(stats.st_mode); | ||
assert!(typ == SFlag::S_IFIFO); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one blank line, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
assert!(typ == SFlag::S_IFIFO); | ||
|
||
|
||
let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part should really be a separate test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
// mkfifoat should fail if a directory is given | ||
assert!(mkfifoat(None, &env::temp_dir(), Mode::S_IRUSR).is_err()); | ||
|
||
let tempdir = tempfile::tempdir().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part should be a separate test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ignore mkfifoat in OSX and andriod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
bors r+
1133: Implement mkfifoat r=asomers a=zmlcc This adds the `mkfifoat ` function, which is part of POSIX [https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.html](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.html) test cases are copied from `mkfifo` Co-authored-by: Zhang Miaolei <zmlcc@outlook.com>
Build succeeded
|
This adds the
mkfifoat
function, which is part of POSIX https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.htmltest cases are copied from
mkfifo