Fix CID 1213701

This commit is contained in:
Anton Kochkov 2014-05-14 06:20:25 +04:00
parent 728dd81352
commit c05313384c

View File

@ -1732,8 +1732,10 @@ static RList *r_debug_native_threads(RDebug *dbg, int pid) {
ptr = strstr (cmdline, "Tgid:");
if (ptr) {
int tgid = atoi (ptr+5);
if (tgid != pid)
if (tgid != pid) {
close (fd);
continue;
}
read (fd, cmdline, sizeof (cmdline)-1);
snprintf (cmdline, sizeof (cmdline), "thread_%d", thid++);
cmdline[sizeof (cmdline)-1] = '\0';