-
Notifications
You must be signed in to change notification settings - Fork 675
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
reuse definitions from libc #561
Conversation
04b8a34
to
45653cc
Compare
} | ||
|
||
pub fn statfs<P: ?Sized + NixPath>(path: &P, stat: &mut vfs::Statfs) -> Result<()> { | ||
pub fn statfs<P: ?Sized + NixPath>(path: &P, stat: &mut libc::statfs) -> Result<()> { |
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 also requires a changelog entry then.
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.
Yes, please add it to this PR.
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.
done
src/sys/statfs.rs
Outdated
pub f_frsize: FragmentSize, | ||
pub f_spare: [SwordType; 5], | ||
} | ||
|
||
pub const ADFS_SUPER_MAGIC : FsType = 0xadf5; |
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.
These definitions are also available in libc. Should I remove them?
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.
Yes, the goal is to get all FFI definitions into libc.
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.
done
This looks pretty good to me. I think we need to resolve the re-exporting of constants and then I think this is good to merge. |
☔ The latest upstream changes (presumably #536) made this pull request unmergeable. Please resolve the merge conflicts. |
CHANGELOG.md
Outdated
@@ -12,6 +12,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). | |||
### Changed | |||
- Marked `sys::mman::{ mmap, munmap, madvise, munlock, msync }` as unsafe. | |||
([#559](https://github.com/nix-rust/nix/pull/559)) | |||
- `nix::sys::statfs::{statfs,fstatfs}` uses statfs definition from `libc::statfs` instead of own type `nix::sys::Statfs`. | |||
Also file system type constants like `nix::sys::statfs::ADFS_SUPER_MAGIC` were removed in favor of the libc aquivalent. |
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.
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.
I'm fine ignoring these constants for now. Eventually I want to implement a wrapper type like this as I've done in #527 for libc::termios
.
Could you fix the spelling of "equivalent" here?
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.
The API advertised here was incorrect anyway on all platforms but linux. All the magic constants are linux specific. BSD* and OS X uses string constants: https://www.freebsd.org/cgi/man.cgi?query=statfs&sektion=2
I'd like if instead of making people use |
There is not feedback from the maintainers of this project. So I will not put effort into this. |
@Mic92 Are you saying you aren't interested in getting this merged? |
It has not highest priority for me at the moment. I could also drop the last commit and only get the others merged. |
That'd be great if you could rebase this and keep only the first 2 commits (be sure to add a CHANGELOG entry for the first commit). |
Mode::from_bits(prev).expect("[BUG] umask returned invalid Mode") | ||
} | ||
|
||
pub fn stat<P: ?Sized + NixPath>(path: &P) -> Result<FileStat> { | ||
let mut dst = unsafe { mem::uninitialized() }; | ||
let res = try!(path.with_nix_path(|cstr| { | ||
unsafe { | ||
ffi::stat(cstr.as_ptr(), &mut dst as *mut FileStat) | ||
libc::stat(cstr.as_ptr(), &mut dst as *mut FileStat) |
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.
Please either pull the changes to use libc::stat/fstat
into a separate commit or change the name of this commit as this doesn't just modify mknod
/umask
.
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.
changed the title.
This needs that spelling fix and cleaning up that one commit, then this should be good to merge. |
5a7cd6a
to
bf82b22
Compare
the previous definition were linux specific.
here we go. |
Great, another little bit of cleanup. Thanks for fixing those commits too, I like a nice commit history! bors r+ |
Timed out |
@bors naughty bot. |
Umlaut:1, Buildbot: 0 Buildbot 0.9.5 has a known problem when a commit's author contains non-ascii characters. That's the cause of the Bors timeout. I'm going to bypass Bors for this one. |
@asomers I'm amazed at how many bugs we've found in buildbot just using it for a brief amount of time. I would've thought most of this would have been ironed out. Anyways, is there a bug filed upstream for that so we could see a fix at somepoint? |
And I thought jenkins is buggy. Umlauts is just the basic case given how many emojis are used in rust projects. |
@Susurrus here's the upstream bug. It's already fixed, but I haven't upgraded our install yet. buildbot/buildbot#3078 . I think this is the only real bug we've found so far. Everything else has been a configuration error on my part. It's still frustrating that it's so hard to come up with a good configuration, and there isn't a template for "Travis Replacement", but we can't blame BuildBot's code for those other problems. |
@asomers Yeah, maybe that's something you can contribute to their docs in your copious spare time! ;-) But I thought there was also the bug about PRs from branches named |
No description provided.