aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools/bazel/files/0001-Rename-gettid-functions.patch
blob: ca3753139119d2cc29dc02215073c717d03ff48d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From a0b885aeb95a7ae9e93aea303a1edde74f71edac Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 3 Apr 2020 10:25:49 +0800
Subject: [PATCH] Rename gettid() functions.

glibc 2.30 will declare its own gettid; see
https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92.
Rename the grpc versions to avoid naming conflicts.

Signed-off-by: Benjamin Peterson <benjamin@dropbox.com>
Upstream-Status: Backport [https://github.com/grpc/grpc/commit/57586a1ca7f17b1916aed3dea4ff8de872dbf853]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 third_party/grpc/src/core/support/log_linux.c | 4 ++--
 third_party/grpc/src/core/support/log_posix.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/third_party/grpc/src/core/support/log_linux.c b/third_party/grpc/src/core/support/log_linux.c
index 93a0c1b..367c921 100755
--- a/third_party/grpc/src/core/support/log_linux.c
+++ b/third_party/grpc/src/core/support/log_linux.c
@@ -54,7 +54,7 @@
 #include <sys/syscall.h>
 #include <unistd.h>
 
-static long gettid(void) { return syscall(__NR_gettid); }
+static long sys_gettid(void) { return syscall(__NR_gettid); }
 
 void gpr_log(const char *file, int line, gpr_log_severity severity,
              const char *format, ...) {
@@ -95,7 +95,7 @@ void gpr_default_log(gpr_log_func_args *args) {
 
   gpr_asprintf(&prefix, "%s%s.%09d %7tu %s:%d]",
                gpr_log_severity_string(args->severity), time_buffer,
-               (int)(now.tv_nsec), gettid(), display_file, args->line);
+               (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
 
   fprintf(stderr, "%-60s %s\n", prefix, args->message);
   gpr_free(prefix);
diff --git a/third_party/grpc/src/core/support/log_posix.c b/third_party/grpc/src/core/support/log_posix.c
index 3ff171f..f0420a7 100755
--- a/third_party/grpc/src/core/support/log_posix.c
+++ b/third_party/grpc/src/core/support/log_posix.c
@@ -45,7 +45,7 @@
 #include <time.h>
 #include <pthread.h>
 
-static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
+static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
 
 void gpr_log(const char *file, int line, gpr_log_severity severity,
              const char *format, ...) {
@@ -95,7 +95,7 @@ void gpr_default_log(gpr_log_func_args *args) {
 
   fprintf(stderr, "%s%s.%09d %7tu %s:%d] %s\n",
           gpr_log_severity_string(args->severity), time_buffer,
-          (int)(now.tv_nsec), gettid(), display_file, args->line,
+          (int)(now.tv_nsec), sys_gettid(), display_file, args->line,
           args->message);
 }
 
-- 
2.17.1