From d53fc6afffb035ff7b7777ad96cfeb26fc80d6fb Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jeremy@system76.com>
Date: Sat, 8 Dec 2018 08:18:21 -0700
Subject: [PATCH] Handle sigterm instead of sigkill

---
 src/bin/mount.rs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/bin/mount.rs b/src/bin/mount.rs
index 833d239..452fe9d 100644
--- a/src/bin/mount.rs
+++ b/src/bin/mount.rs
@@ -20,7 +20,7 @@ use std::sync::atomic::Ordering;
 use uuid::Uuid;
 
 #[cfg(target_os = "redox")]
-use syscall::{sigaction, SigAction, SIGKILL};
+use syscall::{sigaction, SigAction, SIGTERM};
 use redoxfs::IS_UMT;
 
 #[cfg(target_os = "redox")]
@@ -33,11 +33,13 @@ extern "C" fn unmount_handler(_s: usize) {
 //for, so I put 2. I don't think 0,0 is a valid sa_mask. I don't know what i'm doing here. When u
 //send it a sigkill, it shuts off the filesystem
 fn setsig() {
-    sigaction(SIGKILL,Some(&SigAction{
+    let sig_action = SigAction {
         sa_handler: unmount_handler,
         sa_mask: [0,0],
         sa_flags: 0,
-    }),None).unwrap();
+    };
+
+    sigaction(SIGTERM, Some(&sig_action), None).unwrap();
 }
 
 #[cfg(unix)]
-- 
GitLab