[refactor] Do not hardcode executable path, use std::env::current_exe() instead

main
Shinyzenith 2 years ago
parent f77fb6049b
commit a9e66360a9
No known key found for this signature in database
GPG Key ID: A3DFCDC66E9E2950

@ -31,8 +31,7 @@ fn main() -> Result<(), Box<dyn Error>> {
sys.refresh_all();
for (pid, process) in sys.processes() {
if pid.to_string() == swhkd_pid {
if process.exe() == Path::new("/usr/local/bin/swhks") {
// this is the test hunk
if process.exe() == env::current_exe().unwrap() {
log::error!("Server is already running!");
exit(1);
}

Loading…
Cancel
Save