Adapted old code to fit new codebase

This commit is contained in:
2025-03-15 17:54:08 -04:00
parent d4f8f023af
commit 7f21e5baa7
5 changed files with 81 additions and 29 deletions

View File

@@ -76,6 +76,7 @@ impl<'a> ChildProc {
if let Some(pgid) = pgid {
child.set_pgid(pgid).ok();
}
flog!(TRACE, "new child: {:?}", child);
Ok(child)
}
pub fn pid(&self) -> Pid {
@@ -149,6 +150,12 @@ impl JobBldr {
children: self.children
}
}
pub fn set_pgid(&mut self, pgid: Pid) {
self.pgid = Some(pgid);
}
pub fn pgid(&self) -> Option<Pid> {
self.pgid
}
pub fn with_children(self, children: Vec<ChildProc>) -> Self {
Self {
table_id: self.table_id,
@@ -156,6 +163,9 @@ impl JobBldr {
children
}
}
pub fn push_child(&mut self, child: ChildProc) {
self.children.push(child);
}
pub fn build(self) -> Job {
Job {
table_id: self.table_id,