diff --git a/src/lib.rs b/src/lib.rs index 8efc81bbc99976f6ea91dd2081ebce2a9a1f7e5d..d1530afd86ea22bfd1ef0111fbac0255ec6694c1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,9 +1,9 @@ use libc; -use libc::{__errno_location}; +use libc::__errno_location; use libc::{c_char, c_int, c_void, size_t, ssize_t}; -use std::str; use std::ffi::CStr; +use std::str; /// Get error message string /// @@ -64,7 +64,6 @@ pub fn perror(s: &str) { eprintln!("{}: {}", s, strerror(errnum)); } - /// Get error return value /// /// The function `get_errno` gets the current global error number `errno`, used @@ -226,8 +225,6 @@ pub fn write(fildes: c_int, buf: &[c_char], nbyte: size_t) -> ssize_t { return unsafe { libc::write(fildes, buf, nbyte) }; } - - /// Open file /// /// The `open()` function creates a connection between a file named by the @@ -301,7 +298,6 @@ pub fn open(path: &str, oflag: c_int) -> c_int { // return unsafe { libc::open(path, oflag, mode) }; //} - /// Close a file descriptor /// /// The `close()` function shall deallocate the file descriptor `fildes`.