summaryrefslogtreecommitdiff
path: root/src/unistd.rs
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2018-01-14 09:28:41 -0800
committerBryant Mairs <bryantmairs@google.com>2018-01-28 15:35:35 -0800
commit914cda7cc984c79165d5038e07132fdb94780cee (patch)
tree8ef7939c274416cad52cdb94511f4e1a6caf9aea /src/unistd.rs
parent899eff72f92cbc300fbd7779957907a39aa0e42b (diff)
downloadnix-914cda7cc984c79165d5038e07132fdb94780cee.zip
Deny unused qualifications
Diffstat (limited to 'src/unistd.rs')
-rw-r--r--src/unistd.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/unistd.rs b/src/unistd.rs
index 0f47a7fc..4649ae3b 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -503,14 +503,14 @@ pub fn getcwd() -> Result<PathBuf> {
let mut buf = Vec::with_capacity(512);
loop {
unsafe {
- let ptr = buf.as_mut_ptr() as *mut libc::c_char;
+ let ptr = buf.as_mut_ptr() as *mut c_char;
// The buffer must be large enough to store the absolute pathname plus
// a terminating null byte, or else null is returned.
// To safely handle this we start with a reasonable size (512 bytes)
// and double the buffer size upon every error
if !libc::getcwd(ptr, buf.capacity()).is_null() {
- let len = CStr::from_ptr(buf.as_ptr() as *const libc::c_char).to_bytes().len();
+ let len = CStr::from_ptr(buf.as_ptr() as *const c_char).to_bytes().len();
buf.set_len(len);
buf.shrink_to_fit();
return Ok(PathBuf::from(OsString::from_vec(buf)));
@@ -852,10 +852,10 @@ pub enum Whence {
/// Move the read/write file offset.
///
/// See also [lseek(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html)
-pub fn lseek(fd: RawFd, offset: libc::off_t, whence: Whence) -> Result<libc::off_t> {
+pub fn lseek(fd: RawFd, offset: off_t, whence: Whence) -> Result<off_t> {
let res = unsafe { libc::lseek(fd, offset, whence as i32) };
- Errno::result(res).map(|r| r as libc::off_t)
+ Errno::result(res).map(|r| r as off_t)
}
#[cfg(any(target_os = "linux", target_os = "android"))]
@@ -1329,7 +1329,7 @@ pub fn pause() {
/// See also [sleep(2)](http://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html#tag_03_705_05)
// Per POSIX, does not fail
#[inline]
-pub fn sleep(seconds: libc::c_uint) -> c_uint {
+pub fn sleep(seconds: c_uint) -> c_uint {
unsafe { libc::sleep(seconds) }
}