Verified Commit 59d74e19 authored by jD91mZM2's avatar jD91mZM2

Fix CI

parent eb2fe793
Pipeline #1232 passed with stages
in 13 minutes and 56 seconds
......@@ -10,8 +10,9 @@ before_script:
- rustup target add x86_64-unknown-redox --toolchain "$(cat rust-toolchain)"
- rustup show # Print version info for debugging
cache:
untracked: true
# Cache caused some issues with a header not being generated:
# cache:
# untracked: true
build:linux:
stage: build
......
......@@ -101,23 +101,20 @@ pub unsafe extern "C" fn inet_ntop(
#[no_mangle]
pub extern "C" fn inet_addr(cp: *const c_char) -> in_addr_t {
let mut val: in_addr = in_addr {
s_addr: 0,
};
let mut val: in_addr = in_addr { s_addr: 0 };
if unsafe { inet_aton(cp, &mut val) } > 0 {
val.s_addr
} else {
INADDR_NONE
}
}
#[no_mangle]
pub extern "C" fn inet_lnaof(input: in_addr) -> in_addr_t {
if input.s_addr>>24 < 128 {
if input.s_addr >> 24 < 128 {
input.s_addr & 0xffffff
} else if input.s_addr>>24 < 192 {
} else if input.s_addr >> 24 < 192 {
input.s_addr & 0xffff
} else {
input.s_addr & 0xff
......@@ -126,16 +123,14 @@ pub extern "C" fn inet_lnaof(input: in_addr) -> in_addr_t {
#[no_mangle]
pub extern "C" fn inet_makeaddr(net: in_addr_t, host: in_addr_t) -> in_addr {
let mut output: in_addr = in_addr {
s_addr: 0,
};
let mut output: in_addr = in_addr { s_addr: 0 };
if net < 256 {
output.s_addr = host | net<<24;
output.s_addr = host | net << 24;
} else if net < 65536 {
output.s_addr = host | net<<16;
output.s_addr = host | net << 16;
} else {
output.s_addr = host | net<<8;
output.s_addr = host | net << 8;
}
output
......@@ -143,17 +138,15 @@ pub extern "C" fn inet_makeaddr(net: in_addr_t, host: in_addr_t) -> in_addr {
#[no_mangle]
pub extern "C" fn inet_netof(input: in_addr) -> in_addr_t {
if input.s_addr>>24 < 128 {
if input.s_addr >> 24 < 128 {
input.s_addr & 0xffffff
} else if input.s_addr>>24 < 192 {
} else if input.s_addr >> 24 < 192 {
input.s_addr & 0xffff
} else {
input.s_addr & 0xff
}
}
#[no_mangle]
pub extern "C" fn inet_network(cp: *mut c_char) -> in_addr_t {
ntohl(inet_addr(cp))
......
......@@ -21,7 +21,7 @@ use header::sys_times::tms;
use header::sys_utsname::utsname;
use header::termios::termios;
use header::time::timespec;
use header::unistd::{F_OK, R_OK, W_OK, X_OK, SEEK_SET};
use header::unistd::{F_OK, R_OK, SEEK_SET, W_OK, X_OK};
use super::types::*;
use super::{errno, FileReader, FileWriter, Line, Pal, RawFile, RawLineBuffer, Read};
......@@ -195,7 +195,7 @@ impl Pal for Sys {
match Self::read(*fd, &mut shebang) {
0 => break,
i if i < 0 => return -1,
i => read += i
i => read += i,
}
}
......@@ -210,7 +210,7 @@ impl Pal for Sys {
Line::Some(line) => {
let mut path = match CString::new(line) {
Ok(path) => path,
Err(_) => return -1
Err(_) => return -1,
};
match RawFile::open(&path, O_RDONLY as c_int, 0) {
Ok(file) => {
......@@ -220,8 +220,8 @@ impl Pal for Sys {
let path_ref = _interpreter_path.as_ref().unwrap();
args.push([path_ref.as_ptr() as usize, path_ref.to_bytes().len()]);
},
Err(_) => return -1
}
Err(_) => return -1,
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment