From 5867d047ce2f73c536087307cce4fd8d98dbc8ae Mon Sep 17 00:00:00 2001 From: lind Date: Sat, 23 Nov 2024 22:36:55 +0000 Subject: [PATCH] fix: build errors --- src/safeposix/dispatcher.rs | 5 +++-- src/safeposix/vmmap.rs | 2 +- src/tests/sys_tests.rs | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/safeposix/dispatcher.rs b/src/safeposix/dispatcher.rs index 814a2409..9e60b02a 100644 --- a/src/safeposix/dispatcher.rs +++ b/src/safeposix/dispatcher.rs @@ -133,6 +133,7 @@ use crate::interface::types; use crate::interface::{SigactionStruct, StatData}; use crate::{fdtables, interface}; use crate::interface::errnos::*; +use crate::constants::{O_RDONLY, O_WRONLY}; macro_rules! get_onearg { ($arg: expr) => { @@ -1105,8 +1106,8 @@ pub fn lindrustinit(verbosity: isize) { // STDIN let dev_null = CString::new("/home/lind/lind_project/src/safeposix-rust/tmp/dev/null").unwrap(); unsafe { - libc::open(dev_null.as_ptr(), libc::O_RDONLY); - libc::open(dev_null.as_ptr(), libc::O_WRONLY); + libc::open(dev_null.as_ptr(), O_RDONLY); + libc::open(dev_null.as_ptr(), O_WRONLY); libc::dup(1); } diff --git a/src/safeposix/vmmap.rs b/src/safeposix/vmmap.rs index 32f40f9a..7e2eface 100644 --- a/src/safeposix/vmmap.rs +++ b/src/safeposix/vmmap.rs @@ -71,7 +71,7 @@ impl VmmapEntry { // this is effectively whatever mode the file was opened with // we need this because we shouldnt be able to change filed backed mappings // to have protections exceeding that of the file - fn get_max_prot(&self, cage_id: u64, virtual_fd: u64 -> i32 { + fn get_max_prot(&self, cage_id: u64, virtual_fd: u64) -> i32 { let wrappedvfd = fdtables::translate_virtual_fd(cage_id, virtual_fd as u64); if wrappedvfd.is_err() { diff --git a/src/tests/sys_tests.rs b/src/tests/sys_tests.rs index f72b4f1c..78419ded 100644 --- a/src/tests/sys_tests.rs +++ b/src/tests/sys_tests.rs @@ -6,6 +6,7 @@ pub mod sys_tests { use super::super::*; use crate::interface; + use crate::constants::DEFAULT_UID; // use crate::safeposix::cage::{FileDescriptor::*, *}; use crate::safeposix::{cage::*, dispatcher::*, filesystem};