From b789cda4b80d296ab60543a111c64eb792754918 Mon Sep 17 00:00:00 2001 From: Vitaliy Cherepanov Date: Thu, 10 Jul 2014 15:04:36 +0400 Subject: [PATCH] [FIX] fix pid tid get functions on fork Change-Id: I351119b8277ad9ec28847da17b557ec737e027aa Signed-off-by: Vitaliy Cherepanov --- helper/daforkexec.c | 1 + helper/libdaprobe.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/helper/daforkexec.c b/helper/daforkexec.c index b08bb33..d541def 100644 --- a/helper/daforkexec.c +++ b/helper/daforkexec.c @@ -201,6 +201,7 @@ pid_t fork(void) PRINTMSG("", res); if (res == 0) { + reset_pid_tid(); /* important reset pid values */ if (gTraceInfo.socket.daemonSock >= 0) { close(gTraceInfo.socket.daemonSock); _init_(); diff --git a/helper/libdaprobe.c b/helper/libdaprobe.c index ca83eb1..eca1f05 100755 --- a/helper/libdaprobe.c +++ b/helper/libdaprobe.c @@ -187,6 +187,12 @@ static int determineCaller(char* tracestring) } } +void reset_pid_tid() +{ + gPid = -1; + gTid = -1; +} + // return current process id static pid_t _getpid() { -- 2.7.4