Skip to content

Commit

Permalink
#112 followup (bugfix and fix build) (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhiy Barhamon authored Dec 13, 2021
1 parent a336e48 commit 1f9c2b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions kernel/process/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{
elf::{Elf, ProgramHeader},
init_stack::{estimate_user_init_stack_size, init_user_stack, Auxv},
process_group::{PgId, ProcessGroup},
signal::{SigAction, Signal, SignalDelivery, SignalMask, SIGCHLD, SIGKILL},
signal::{SigAction, SigSet, Signal, SignalDelivery, SignalMask, SIGCHLD, SIGKILL},
switch, UserVAddr, JOIN_WAIT_QUEUE, SCHEDULER,
},
random::read_secure_random,
Expand All @@ -38,8 +38,6 @@ use kerla_runtime::{
};
use kerla_utils::{alignment::align_up, bitmap::BitMap};

use super::signal::SigSet;

type ProcessTable = BTreeMap<PId, Arc<Process>>;

/// The process table. All processes are registered in with its process Id.
Expand Down
8 changes: 3 additions & 5 deletions kernel/syscalls/rt_sigprocmask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ impl SyscallHandler<'_> {
oldset: Option<UserVAddr>,
length: usize,
) -> Result<isize> {
if length != 8{
if length != 8 {
debug_warn!("sys_rt_sigprocmask length argument is not equal 8");
}

let how = match how {
0 => SignalMask::Block,
1 => SignalMask::Unblock,
2 => SignalMask::Set,
_ => return Err(Errno::EINVAL.into()),
};

if let Err(_) = current_process().set_signal_mask(how, set, oldset, length) {
return Err(Errno::EFAULT.into());
}
current_process().set_signal_mask(how, set, oldset, length)?;

Ok(0)
}
Expand Down

0 comments on commit 1f9c2b4

Please sign in to comment.