diff --git a/debian/control b/debian/control index 99f35a3..40cd853 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,7 @@ Build-Depends: debhelper (>= 12), rustc:native, pkg-config, libudev-dev, + librust-bindgen-dev, librust-nix-dev, librust-libc-dev, librust-time-dev, diff --git a/vuinputd/src/container/inject_in_container_job.rs b/vuinputd/src/container/inject_in_container_job.rs index 44e9f7d..4d30262 100644 --- a/vuinputd/src/container/inject_in_container_job.rs +++ b/vuinputd/src/container/inject_in_container_job.rs @@ -119,6 +119,7 @@ impl InjectInContainerJob { if runtime_data.is_none() { debug!("Give up reading runtime data"); } + self.set_state(&State::Finished); return; } @@ -143,7 +144,7 @@ impl InjectInContainerJob { })) .expect("subprocess should work"); - let _exit_info = await_process(Pid::Pid(child_pid.as_raw())).await; + let _exit_info = await_process(Pid::Pid(child_pid.as_raw())).await.unwrap(); self.set_state(&State::Finished); } diff --git a/vuinputd/src/container/remove_from_container_job.rs b/vuinputd/src/container/remove_from_container_job.rs index 33a689e..130974b 100644 --- a/vuinputd/src/container/remove_from_container_job.rs +++ b/vuinputd/src/container/remove_from_container_job.rs @@ -92,12 +92,14 @@ impl RemoveFromContainerJob { Some(netlink_event) => netlink_event, None => { debug!("do nothing, because the device has never been announced via netlink"); + self.set_state(&State::Finished); return; } }; if netlink_event.tombstone { debug!("do nothing, because the device has already been removed in the meantime"); + self.set_state(&State::Finished); return; } let netlink_data=netlink_event.add_data; diff --git a/vuinputd/src/main.rs b/vuinputd/src/main.rs index e5089ae..cb47a7b 100644 --- a/vuinputd/src/main.rs +++ b/vuinputd/src/main.rs @@ -520,6 +520,7 @@ unsafe extern "C" fn vuinput_ioctl( let awaiter = inject_job.get_awaiter_for_state(); JOB_DISPATCHER.get().unwrap().lock().unwrap().dispatch(Box::new(inject_job)); awaiter(&container::inject_in_container_job::State::Finished); + debug!("fh {}: injecting dev-nodes in container has been finished ", fh); } // write a SYN-event (which is just zeros) just for validation @@ -538,7 +539,8 @@ unsafe extern "C" fn vuinput_ioctl( let remove_job=RemoveFromContainerJob::new(vuinput_state.requesting_process.clone(),input_device.devnode.clone(),input_device.syspath.clone(),input_device.major,input_device.minor); let awaiter = remove_job.get_awaiter_for_state(); JOB_DISPATCHER.get().unwrap().lock().unwrap().dispatch(Box::new(remove_job)); - awaiter(&container::remove_from_container_job::State::Finished) + awaiter(&container::remove_from_container_job::State::Finished); + debug!("fh {}: removing dev-nodes from container has been finished ", fh); } ui_dev_destroy(fd).unwrap(); diff --git a/vuinputd/src/requesting_process.rs b/vuinputd/src/requesting_process.rs index bc1658c..06b6e51 100644 --- a/vuinputd/src/requesting_process.rs +++ b/vuinputd/src/requesting_process.rs @@ -296,7 +296,7 @@ pub async fn await_process(pid: Pid) -> io::Result { libc::P_PID, pid as u32, &mut si, - libc::WEXITED | libc::WNOWAIT, + libc::WEXITED, ); if r != 0 { return Err(io::Error::last_os_error());