Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/common Fix proc lookup by distinguishing be...



details:   https://anonhg.NetBSD.org/src/rev/d3da67e30b7a
branches:  trunk
changeset: 1009626:d3da67e30b7a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Apr 29 01:55:52 2020 +0000

description:
Fix proc lookup by distinguishing between the "tgid" and "tid" cases.

diffstat:

 sys/compat/linux/common/linux_signal.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (41 lines):

diff -r 8d64da071ef9 -r d3da67e30b7a sys/compat/linux/common/linux_signal.c
--- a/sys/compat/linux/common/linux_signal.c    Wed Apr 29 01:55:18 2020 +0000
+++ b/sys/compat/linux/common/linux_signal.c    Wed Apr 29 01:55:52 2020 +0000
@@ -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 @@
                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 @@
        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;



Home | Main Index | Thread Index | Old Index