Skip to content

Commit 4653033

Browse files
committed
chore: make impl_handler macro self-contained
1 parent bef529e commit 4653033

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/fspy/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ arrayvec = { workspace = true }
2626
blink-alloc = { workspace = true }
2727
fspy_seccomp_unotify = { workspace = true, features = ["supervisor"] }
2828
nix = { workspace = true, features = ["uio"] }
29-
syscalls = { workspace = true, features = ["std"] }
3029
thread_local = { workspace = true }
3130
tokio = { workspace = true, features = ["bytes"] }
3231
tokio-seqpacket = { workspace = true }

crates/fspy_seccomp_unotify/src/supervisor/handler/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ pub trait SeccompNotifyHandler {
99
fn handle_notify(&mut self, notify: &seccomp_notif) -> io::Result<()>;
1010
}
1111

12+
#[doc(hidden)] // Re-export for use in the macro
13+
pub use syscalls::Sysno;
14+
1215
#[macro_export]
1316
macro_rules! impl_handler {
1417
($type:ty: $(
@@ -17,17 +20,17 @@ macro_rules! impl_handler {
1720
)* ) => {
1821

1922
impl $crate::supervisor::handler::SeccompNotifyHandler for $type {
20-
fn syscalls() -> &'static [::syscalls::Sysno] {
23+
fn syscalls() -> &'static [$crate::supervisor::handler::Sysno] {
2124
&[ $(
2225
$(#[$attr])?
23-
::syscalls::Sysno::$syscall
26+
$crate::supervisor::handler::Sysno::$syscall
2427
),* ]
2528
}
2629
fn handle_notify(&mut self, notify: &::libc::seccomp_notif) -> ::std::io::Result<()> {
2730
$crate::supervisor::handler::arg::Caller::with_pid(notify.pid as _, |caller| {
2831
$(
2932
$(#[$attr])?
30-
if notify.data.nr == ::syscalls::Sysno::$syscall as _ {
33+
if notify.data.nr == $crate::supervisor::handler::Sysno::$syscall as _ {
3134
return self.$syscall(caller, $crate::supervisor::handler::arg::FromNotify::from_notify(notify)?)
3235
}
3336
)*

0 commit comments

Comments
 (0)