lkml.org 
[lkml]   [2003]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPID of multi-threaded core's file name is wrong in 2.5.59
Hi,

I found sometimes pid of muitl-threaded core's file name shows
wrong number in 2.5.59 with NPTL-0.17. Problem is, pid of core file
name comes from currnet->pid, but I think it should be current->tgid.

Following patch fixes this problem.

MAEDA Naoaki

diff -Naur linux-2.5.59/fs/exec.c linux-2.5.59-corepidfix/fs/exec.c
--- linux-2.5.59/fs/exec.c 2003-01-17 11:22:02.000000000 +0900
+++ linux-2.5.59-corepidfix/fs/exec.c 2003-01-25 13:20:50.000000000 +0900
@@ -1166,7 +1166,7 @@
case 'p':
pid_in_pattern = 1;
rc = snprintf(out_ptr, out_end - out_ptr,
- "%d", current->pid);
+ "%d", current->tgid);
if (rc > out_end - out_ptr)
goto out;
out_ptr += rc;
@@ -1238,7 +1238,7 @@
if (!pid_in_pattern
&& (core_uses_pid || atomic_read(&current->mm->mm_users) != 1)) {
rc = snprintf(out_ptr, out_end - out_ptr,
- ".%d", current->pid);
+ ".%d", current->tgid);
if (rc > out_end - out_ptr)
goto out;
out_ptr += rc;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.044 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site