[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 b08bb334d7e5b664c9082f84667811ddfb842ef3..d541def7a7ee12f6816e459bdb8e0ac1f8cc1ba0 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 ca83eb1d1dcce3db89c067797cf726a84b7d239a..eca1f05c8df5be28ec17e6228d065c9f5e891806 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()
 {