File fix-tgkill-declaration.patch of Package firefox45esr

commit: 7e3c165000d44fa153a3270870ed500bc8bbb461
author: Nicholas Baldwin <baldwinn@google.com>
committer: Mark Mentovai <mark@chromium.org>
tree: e96f5a6e7b5c40769e29931bf949439093e5c93e
parent: fd0a0d2b7ae9dd3d8a02b6a12e7941f7189fbb6c

Fix double declaration of tgkill when using Android NDK Headers.

As of Android API level 16 tgkill is declared in the NDK version of
signal.h, which conflicts with the static definition found in
src/client/linux/handler/exception_handler.cc. This change removes
the static tgkill definition and replaces its use with sys_tgkill
from the linux syscall support library.

Bug:
Change-Id: Ic70addd8a064cfa36345d86b7e36409e2089e909
Reviewed-on: https://chromium-review.googlesource.com/738912
Reviewed-by: Mike Frysinger <vapier@chromium.org>

Index: mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
===================================================================
--- mozilla.orig/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
+++ mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
@@ -100,12 +100,6 @@
 #define PR_SET_PTRACER 0x59616d61
 #endif
 
-// A wrapper for the tgkill syscall: send a signal to a specific thread.
-static int tgkill(pid_t tgid, pid_t tid, int sig) {
-  return syscall(__NR_tgkill, tgid, tid, sig);
-  return 0;
-}
-
 namespace google_breakpad {
 
 namespace {
@@ -343,7 +337,7 @@ void ExceptionHandler::SignalHandler(int
     // This signal was sent by another process.  (Positive values of
     // si_code are reserved for kernel-originated signals.)  In order
     // to retrigger it, we have to queue a new signal.
-    if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) {
+    if (sys_tgkill(getpid(), syscall(__NR_gettid), sig) < 0) {
       // If we failed to kill ourselves (e.g. because a sandbox disallows us
       // to do so), we instead resort to terminating our process. This will
       // result in an incorrect exit code.
openSUSE Build Service is sponsored by