git: 3ef02a3d2e85 - main - kill: Fix support for kill -0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Jun 2025 22:24:20 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=3ef02a3d2e853766916a4f80e40ad8ba134b0363
commit 3ef02a3d2e853766916a4f80e40ad8ba134b0363
Author: Ricardo Branco <rbranco@suse.de>
AuthorDate: 2025-06-20 18:04:07 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-06-20 22:24:10 +0000
kill: Fix support for kill -0
Signed-off-by: Ricardo Branco <rbranco@suse.de>
Fixes: 36679f7d7b56 ("kill: Use POSIX str2sig()")
Pull Request: https://github.com/freebsd/freebsd-src/pull/1733
---
bin/kill/kill.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/bin/kill/kill.c b/bin/kill/kill.c
index ca9d557c5883..606c6917bbcf 100644
--- a/bin/kill/kill.c
+++ b/bin/kill/kill.c
@@ -99,7 +99,9 @@ main(int argc, char *argv[])
argc--, argv++;
} else if (**argv == '-' && *(*argv + 1) != '-') {
++*argv;
- if (str2sig(*argv, &numsig) < 0)
+ if (strcmp(*argv, "0") == 0)
+ numsig = 0;
+ else if (str2sig(*argv, &numsig) < 0)
nosig(*argv);
argc--, argv++;
}