Bump to grpc 1.20.1
[platform/upstream/grpc.git] / packaging / 0003-tizen_6_build-Rename-gettid-functions.patch
1 From 58542cb31e1a1d973d9a71017c7c431613c3407c Mon Sep 17 00:00:00 2001
2 From: Benjamin Peterson <benjamin@dropbox.com>
3 Date: Fri, 3 May 2019 08:11:00 -0700
4 Subject: [PATCH 3/3] [tizen_6_build] Rename gettid() functions.
5
6 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.
7
8 (cherry picked from commit 57586a1ca7f17b1916aed3dea4ff8de872dbf853)
9
10 Change-Id: I29c34cc0a68140bb5ba728a44eb0e1d38819b20a
11 Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
12 ---
13  src/core/lib/gpr/log_linux.cc          | 4 ++--
14  src/core/lib/gpr/log_posix.cc          | 4 ++--
15  src/core/lib/iomgr/ev_epollex_linux.cc | 4 ++--
16  3 files changed, 6 insertions(+), 6 deletions(-)
17
18 diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
19 index 561276f..8b597b4 100644
20 --- a/src/core/lib/gpr/log_linux.cc
21 +++ b/src/core/lib/gpr/log_linux.cc
22 @@ -40,7 +40,7 @@
23  #include <time.h>
24  #include <unistd.h>
25  
26 -static long gettid(void) { return syscall(__NR_gettid); }
27 +static long sys_gettid(void) { return syscall(__NR_gettid); }
28  
29  void gpr_log(const char* file, int line, gpr_log_severity severity,
30               const char* format, ...) {
31 @@ -70,7 +70,7 @@ void gpr_default_log(gpr_log_func_args* args) {
32    gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
33    struct tm tm;
34    static __thread long tid = 0;
35 -  if (tid == 0) tid = gettid();
36 +  if (tid == 0) tid = sys_gettid();
37  
38    timer = static_cast<time_t>(now.tv_sec);
39    final_slash = strrchr(args->file, '/');
40 diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc
41 index 0acb225..cd0b702 100644
42 --- a/src/core/lib/gpr/log_posix.cc
43 +++ b/src/core/lib/gpr/log_posix.cc
44 @@ -30,7 +30,7 @@
45  #include <string.h>
46  #include <time.h>
47  
48 -static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
49 +static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
50  
51  void gpr_log(const char* file, int line, gpr_log_severity severity,
52               const char* format, ...) {
53 @@ -85,7 +85,7 @@ void gpr_default_log(gpr_log_func_args* args) {
54    char* prefix;
55    gpr_asprintf(&prefix, "%s%s.%09d %7tu %s:%d]",
56                 gpr_log_severity_string(args->severity), time_buffer,
57 -               (int)(now.tv_nsec), gettid(), display_file, args->line);
58 +               (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
59  
60    fprintf(stderr, "%-70s %s\n", prefix, args->message);
61    gpr_free(prefix);
62 diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
63 index 7a4870d..4258ded 100644
64 --- a/src/core/lib/iomgr/ev_epollex_linux.cc
65 +++ b/src/core/lib/iomgr/ev_epollex_linux.cc
66 @@ -1150,7 +1150,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
67  }
68  
69  #ifndef NDEBUG
70 -static long gettid(void) { return syscall(__NR_gettid); }
71 +static long sys_gettid(void) { return syscall(__NR_gettid); }
72  #endif
73  
74  /* pollset->mu lock must be held by the caller before calling this.
75 @@ -1170,7 +1170,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
76  #define WORKER_PTR (&worker)
77  #endif
78  #ifndef NDEBUG
79 -  WORKER_PTR->originator = gettid();
80 +  WORKER_PTR->originator = sys_gettid();
81  #endif
82    if (grpc_polling_trace.enabled()) {
83      gpr_log(GPR_INFO,
84 -- 
85 2.7.4
86