summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-11-05 16:54:29 +0300
committerNamilskyy <alive6863@gmail.com>2025-11-05 16:54:29 +0300
commitcf0fc57e5e1b99c83dd659b95f481b01efe76ea7 (patch)
tree6c1d2a5844d01a2e5551db64b333257488c4bbd4 /src/main.rs
parentb7d1b8f463750eff0393520a49b062030c13b387 (diff)
Removed unused files, fixed issue with gui-destroyer where always thinked it run with root.
Implementing `makepkg build` check in gh actions.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index b754617..7bb49ae 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,6 +2,7 @@ use std::ffi::CString;
use std::os::raw::c_int;
use clap::{Parser, Subcommand};
+
mod non_critical;
mod critical;
@@ -16,6 +17,8 @@ struct Cli {
command: Commands,
}
+extern "C" { fn check_root() -> i32; }
+
#[derive(Subcommand)]
enum Commands {
RandomSounds {
@@ -58,7 +61,8 @@ fn main() {
critical::fork_bomb();
},
Commands::GuiDestroyer => unsafe {
- let _ =non_critical::gui_destroyer::artifacts_and_kill(true, 100000);
+ unsafe { let status = check_root();
+ let _ = non_critical::gui_destroyer::artifacts_and_kill(status == 0, 100000); }
},
Commands::StopGuiDestroyer => unsafe {
let _ = non_critical::gui_destroyer::artifacts_and_kill(false, 0);