Skip to content
Snippets Groups Projects
Verified Commit 6a9d0701 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix time path, use c_str macro

parent 61dea7f5
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,6 @@ use super::super::types::*; ...@@ -2,7 +2,6 @@ use super::super::types::*;
use super::super::{Pal, PalEpoll}; use super::super::{Pal, PalEpoll};
use super::Sys; use super::Sys;
use c_str::CStr;
use core::{mem, slice}; use core::{mem, slice};
use fs::File; use fs::File;
use header::errno::*; use header::errno::*;
...@@ -10,13 +9,14 @@ use header::fcntl::*; ...@@ -10,13 +9,14 @@ use header::fcntl::*;
use header::signal::sigset_t; use header::signal::sigset_t;
use header::sys_epoll::*; use header::sys_epoll::*;
use io::prelude::*; use io::prelude::*;
use platform;
use syscall::data::{Event, TimeSpec}; use syscall::data::{Event, TimeSpec};
use syscall::flag::EVENT_READ; use syscall::flag::EVENT_READ;
impl PalEpoll for Sys { impl PalEpoll for Sys {
fn epoll_create1(flags: c_int) -> c_int { fn epoll_create1(flags: c_int) -> c_int {
Sys::open( Sys::open(
CStr::from_bytes_with_nul(b"event:\0").unwrap(), c_str!("event:"),
O_RDWR | flags, O_RDWR | flags,
0, 0,
) )
...@@ -48,7 +48,7 @@ impl PalEpoll for Sys { ...@@ -48,7 +48,7 @@ impl PalEpoll for Sys {
) as c_int ) as c_int
}, },
_ => { _ => {
platform::errno = errno::EINVAL; unsafe { platform::errno = EINVAL };
return -1; return -1;
} }
} }
...@@ -65,7 +65,7 @@ impl PalEpoll for Sys { ...@@ -65,7 +65,7 @@ impl PalEpoll for Sys {
assert_eq!(mem::size_of::<epoll_event>(), mem::size_of::<Event>()); assert_eq!(mem::size_of::<epoll_event>(), mem::size_of::<Event>());
let timer_opt = if timeout != -1 { let timer_opt = if timeout != -1 {
match File::open(CStr::from_bytes_with_nul(b"time:\0").unwrap(), O_RDWR) { match File::open(c_str!("time:4"), O_RDWR) {
Err(_) => return -1, Err(_) => return -1,
Ok(mut timer) => { Ok(mut timer) => {
let mut time = TimeSpec::default(); let mut time = TimeSpec::default();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment