shithub: npe

Download patch

ref: f92a0f226bb1ed8e2a53f7790f558ccc53877630
parent: 61c16aebdaf9d0629ba6b54c2280eafefdef66fd
author: Noam Preil <noam@pixelhero.dev>
date: Fri Dec 12 04:54:31 EST 2025

clean up kill

--- a/libnpe/kill.c
+++ b/libnpe/kill.c
@@ -29,12 +29,9 @@
 int
 kill(int pid, int sig)
 {
-	char *msg = nil;
-	if(sig >= 0 && sig <= SIGTERM)
-		msg = killnotes[sig];
-	if(msg == nil)
+	if(sig < 0 || sig > SIGTERM || killnotes[sig] == nil)
 		return -1;
 	if(pid == 0)
-		return note(getpid(), msg, "/proc/%d/notepg");
-	return note(pid, msg, "/proc/%d/note");
+		return note(getpid(), killnotes[sig], "/proc/%d/notepg");
+	return note(pid, killnotes[sig], "/proc/%d/note");
 }
--