summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarcnmx <arcnmx@users.noreply.github.com>2016-01-05 17:38:23 -0500
committerarcnmx <arcnmx@users.noreply.github.com>2016-04-18 15:45:59 -0400
commitcb516575a528ae5b07f5a49c64517801b864564b (patch)
tree3e6c731b8af22e12d704462fb784848fb6cafa15
parent9d912ae8db33515ad736715a5f2841c489d83517 (diff)
downloadnix-cb516575a528ae5b07f5a49c64517801b864564b.zip
Use Void in exec return type
-rw-r--r--Cargo.toml3
-rw-r--r--src/lib.rs1
-rw-r--r--src/unistd.rs7
3 files changed, 7 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 2f2663ad..bb1c8157 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,9 +23,10 @@ preadv_pwritev = []
signalfd = []
[dependencies]
-libc = "0.2.8"
+libc = "0.2.8"
bitflags = "0.4"
cfg-if = "0.1.0"
+void = "1.0.2"
[build-dependencies]
rustc_version = "0.1.7"
diff --git a/src/lib.rs b/src/lib.rs
index 929d6105..e746c6b2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -15,6 +15,7 @@ extern crate bitflags;
#[macro_use]
extern crate cfg_if;
+extern crate void;
#[cfg(test)]
extern crate nix_test as nixtest;
diff --git a/src/unistd.rs b/src/unistd.rs
index a1200680..71448248 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -7,6 +7,7 @@ use libc::{self, c_char, c_void, c_int, c_uint, size_t, pid_t, off_t, uid_t, gid
use std::mem;
use std::ffi::CString;
use std::os::unix::io::RawFd;
+use void::Void;
#[cfg(any(target_os = "linux", target_os = "android"))]
pub use self::linux::*;
@@ -130,7 +131,7 @@ fn to_exec_array(args: &[CString]) -> Vec<*const c_char> {
}
#[inline]
-pub fn execv(path: &CString, argv: &[CString]) -> Result<()> {
+pub fn execv(path: &CString, argv: &[CString]) -> Result<Void> {
let args_p = to_exec_array(argv);
unsafe {
@@ -141,7 +142,7 @@ pub fn execv(path: &CString, argv: &[CString]) -> Result<()> {
}
#[inline]
-pub fn execve(path: &CString, args: &[CString], env: &[CString]) -> Result<()> {
+pub fn execve(path: &CString, args: &[CString], env: &[CString]) -> Result<Void> {
let args_p = to_exec_array(args);
let env_p = to_exec_array(env);
@@ -153,7 +154,7 @@ pub fn execve(path: &CString, args: &[CString], env: &[CString]) -> Result<()> {
}
#[inline]
-pub fn execvp(filename: &CString, args: &[CString]) -> Result<()> {
+pub fn execvp(filename: &CString, args: &[CString]) -> Result<Void> {
let args_p = to_exec_array(args);
unsafe {