Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
ti3-rust
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
koenigl2
ti3-rust
Commits
706ae7e1
Commit
706ae7e1
authored
Jul 16, 2020
by
koenigl
Browse files
Options
Downloads
Patches
Plain Diff
cargo fmt
parent
dd4e1faf
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib.rs
+2
-6
2 additions, 6 deletions
src/lib.rs
with
2 additions
and
6 deletions
src/lib.rs
+
2
−
6
View file @
706ae7e1
use
libc
;
use
libc
;
use
libc
::
{
__errno_location
}
;
use
libc
::
__errno_location
;
use
libc
::{
c_char
,
c_int
,
c_void
,
size_t
,
ssize_t
};
use
libc
::{
c_char
,
c_int
,
c_void
,
size_t
,
ssize_t
};
use
std
::
str
;
use
std
::
ffi
::
CStr
;
use
std
::
ffi
::
CStr
;
use
std
::
str
;
/// Get error message string
/// Get error message string
///
///
...
@@ -64,7 +64,6 @@ pub fn perror(s: &str) {
...
@@ -64,7 +64,6 @@ pub fn perror(s: &str) {
eprintln!
(
"{}: {}"
,
s
,
strerror
(
errnum
));
eprintln!
(
"{}: {}"
,
s
,
strerror
(
errnum
));
}
}
/// Get error return value
/// Get error return value
///
///
/// The function `get_errno` gets the current global error number `errno`, used
/// 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 {
...
@@ -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
)
};
return
unsafe
{
libc
::
write
(
fildes
,
buf
,
nbyte
)
};
}
}
/// Open file
/// Open file
///
///
/// The `open()` function creates a connection between a file named by the
/// 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 {
...
@@ -301,7 +298,6 @@ pub fn open(path: &str, oflag: c_int) -> c_int {
// return unsafe { libc::open(path, oflag, mode) };
// return unsafe { libc::open(path, oflag, mode) };
//}
//}
/// Close a file descriptor
/// Close a file descriptor
///
///
/// The `close()` function shall deallocate the file descriptor `fildes`.
/// The `close()` function shall deallocate the file descriptor `fildes`.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment