Module Name: src Committed By: thorpej Date: Wed Apr 29 01:55:52 UTC 2020
Modified Files: src/sys/compat/linux/common: linux_signal.c Log Message: Fix proc lookup by distinguishing between the "tgid" and "tid" cases. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/common/linux_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/compat/linux/common/linux_signal.c diff -u src/sys/compat/linux/common/linux_signal.c:1.81 src/sys/compat/linux/common/linux_signal.c:1.82 --- src/sys/compat/linux/common/linux_signal.c:1.81 Fri Aug 23 08:31:11 2019 +++ src/sys/compat/linux/common/linux_signal.c Wed Apr 29 01:55:52 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_signal.c,v 1.81 2019/08/23 08:31:11 maxv Exp $ */ +/* $NetBSD: linux_signal.c,v 1.82 2020/04/29 01:55:52 thorpej Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.81 2019/08/23 08:31:11 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.82 2020/04/29 01:55:52 thorpej Exp $"); #define COMPAT_LINUX 1 @@ -749,10 +749,6 @@ linux_do_tkill(struct lwp *l, int tgid, return EINVAL; signum = linux_to_native_signo[signum]; - if (tgid == -1) { - tgid = tid; - } - KSI_INIT(&ksi); ksi.ksi_signo = signum; ksi.ksi_code = SI_LWP; @@ -761,7 +757,10 @@ linux_do_tkill(struct lwp *l, int tgid, ksi.ksi_lid = tid; mutex_enter(proc_lock); - p = proc_find(tgid); + if (tgid != -1) + p = proc_find(tgid); + else + p = proc_find_lwpid(tid); if (p == NULL) { mutex_exit(proc_lock); return ESRCH;