Commit ba0ea4b5 authored by Robin Randhawa's avatar Robin Randhawa

Fix build breakage: Use relevant syscall Flag structs

parent 5ff37f1f
Pipeline #7189 failed with stages
in 1 minute and 54 seconds
......@@ -32,9 +32,9 @@ fn setsig() {
use syscall::{sigaction, SigAction, SIGTERM};
let sig_action = SigAction {
sa_handler: unmount_handler,
sa_handler: Some(unmount_handler),
sa_mask: [0, 0],
sa_flags: 0,
sa_flags: syscall::SigActionFlags::empty(),
};
sigaction(SIGTERM, Some(&sig_action), None).unwrap();
......@@ -63,7 +63,7 @@ fn capability_mode() {
#[cfg(target_os = "redox")]
fn fork() -> isize {
unsafe { syscall::Error::mux(syscall::clone(0)) as isize }
unsafe { syscall::Error::mux(syscall::clone(syscall::CloneFlags::empty())) as isize }
}
#[cfg(target_os = "redox")]
......
......@@ -7,7 +7,7 @@ use syscall::data::{Map, Stat, TimeSpec};
use syscall::error::{Error, Result, EBADF, EINVAL, EISDIR, ENOMEM, EPERM};
use syscall::flag::{
F_GETFL, F_SETFL, MODE_PERM, O_ACCMODE, O_APPEND, O_RDONLY, O_RDWR, O_WRONLY, PROT_READ,
PROT_WRITE, SEEK_CUR, SEEK_END, SEEK_SET,
PROT_WRITE, SEEK_CUR, SEEK_END, SEEK_SET, MapFlags
};
use disk::Disk;
......@@ -200,7 +200,7 @@ impl<D: Disk> Resource<D> for DirResource {
pub struct Fmap {
block: u64,
offset: usize,
flags: usize,
flags: syscall::MapFlags,
data: &'static mut [u8],
}
......@@ -242,7 +242,7 @@ impl Fmap {
}
pub fn sync<D: Disk>(&mut self, fs: &mut FileSystem<D>) -> Result<()> {
if self.flags & PROT_WRITE == PROT_WRITE {
if self.flags.contains(syscall::MapFlags::PROT_WRITE) {
let mtime = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
fs.write_node(
self.block,
......@@ -355,10 +355,10 @@ impl<D: Disk> Resource<D> for FileResource {
fn fmap(&mut self, map: &Map, fs: &mut FileSystem<D>) -> Result<usize> {
let accmode = self.flags & O_ACCMODE;
if map.flags & PROT_READ > 0 && !(accmode == O_RDWR || accmode == O_RDONLY) {
if map.flags.contains(syscall::MapFlags::PROT_READ) && !(accmode == O_RDWR || accmode == O_RDONLY) {
return Err(Error::new(EBADF));
}
if map.flags & PROT_WRITE > 0 && !(accmode == O_RDWR || accmode == O_WRONLY) {
if map.flags.contains(syscall::MapFlags::PROT_WRITE) && !(accmode == O_RDWR || accmode == O_WRONLY) {
return Err(Error::new(EBADF));
}
//TODO: PROT_EXEC?
......
......@@ -528,7 +528,7 @@ impl<D: Disk> Scheme for FileScheme<D> {
}
}
fn fevent(&self, id: usize, flags: usize) -> Result<usize> {
fn fevent(&self, id: usize, _flags: syscall::EventFlags) -> Result<syscall::EventFlags> {
let files = self.files.borrow_mut();
if let Some(file) = files.get(&id) {
// EPERM is returned for files that are always readable or writable
......
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