Disable graphical debug only once writing to the fd

This allows obtaining an fd for this before calling setrens while doing
the actual disabling after calling it.
This commit is contained in:
bjorn3
2025-04-06 17:13:26 +02:00
parent 81374e6f7b
commit 8f589f7b88
+8 -6
View File
@@ -61,12 +61,7 @@ impl KernelScheme for DebugScheme {
"no-preserve" => SpecialFds::NoPreserve as usize,
"disable-graphical-debug" => {
#[cfg(feature = "graphical_debug")]
graphical_debug::fini();
SpecialFds::DisableGraphicalDebug as usize
}
"disable-graphical-debug" => SpecialFds::DisableGraphicalDebug as usize,
#[cfg(feature = "profiling")]
p if p.starts_with("profiling-") => {
@@ -165,6 +160,13 @@ impl KernelScheme for DebugScheme {
return Ok(1);
}
if handle.num == SpecialFds::DisableGraphicalDebug as usize {
#[cfg(feature = "graphical_debug")]
graphical_debug::fini();
return Ok(0);
}
if handle.num != SpecialFds::Default as usize
&& handle.num != SpecialFds::NoPreserve as usize
{