[FIX] fix pid tid get functions on fork 18/24318/1
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Thu, 10 Jul 2014 11:04:36 +0000 (15:04 +0400)
committerVitaliy Cherepanov <v.cherepanov@samsung.com>
Thu, 10 Jul 2014 11:04:36 +0000 (15:04 +0400)
Change-Id: I351119b8277ad9ec28847da17b557ec737e027aa
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
helper/daforkexec.c
helper/libdaprobe.c

index b08bb33..d541def 100644 (file)
@@ -201,6 +201,7 @@ pid_t fork(void)
 
        PRINTMSG("<fork = %d>", res);
        if (res == 0) {
+               reset_pid_tid(); /* important reset pid values */
                if (gTraceInfo.socket.daemonSock >= 0) {
                        close(gTraceInfo.socket.daemonSock);
                        _init_();
index ca83eb1..eca1f05 100755 (executable)
@@ -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()
 {