Explicitly cast pthread_t to int for logging purposes
authorPavan Deolasee <[email protected]>
Fri, 11 Mar 2016 06:43:10 +0000 (12:13 +0530)
committerPavan Deolasee <[email protected]>
Fri, 11 Mar 2016 06:43:10 +0000 (12:13 +0530)
src/gtm/common/elog.c

index a08dfd292ff7963c5a32aba08c359c6bacbc4487..9388130a4683e77991ea373e2da9f15b468f3425 100644 (file)
@@ -114,10 +114,10 @@ log_line_prefix(StringInfo buf)
         * MyProcPid changes. MyStartTime also changes when MyProcPid does, so
         * reset the formatted start timestamp too.
         */
-       if (log_my_pid != MyThreadID)
+       if (log_my_pid != (int) MyThreadID)
        {
                log_line_number = 0;
-               log_my_pid = MyThreadID;
+               log_my_pid = (int) MyThreadID;
                formatted_start_time[0] = '\0';
        }
        log_line_number++;
@@ -144,7 +144,7 @@ log_line_prefix(StringInfo buf)
                switch (Log_line_prefix[i])
                {
                        case 'p':
-                               appendStringInfo(buf, "%lu", MyThreadID);
+                               appendStringInfo(buf, "%u", (int) MyThreadID);
                                break;
                        case 'l':
                                appendStringInfo(buf, "%ld", log_line_number);