This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 2b4ca01  ARROW-5369: [C++] Add support for glog on Windows
2b4ca01 is described below

commit 2b4ca01898f38a14ac56d4b804be9709100e2e4f
Author: Kouhei Sutou <[email protected]>
AuthorDate: Mon May 20 16:37:17 2019 -0500

    ARROW-5369: [C++] Add support for glog on Windows
    
    Windows doesn't have sigaction() but has signal().
    
    glog also uses signal():
    https://github.com/google/glog/blob/master/src/signalhandler.cc#L390
    
    Author: Kouhei Sutou <[email protected]>
    
    Closes #4342 from kou/cpp-support-glob-on-windows and squashes the 
following commits:
    
    779cfa7af <Kouhei Sutou> Disable glog on AppVeyor
    216d2da8c <Kouhei Sutou>  Add support for glog on Windows
---
 cpp/src/arrow/util/logging.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cpp/src/arrow/util/logging.cc b/cpp/src/arrow/util/logging.cc
index fe9042f..e54a10e 100644
--- a/cpp/src/arrow/util/logging.cc
+++ b/cpp/src/arrow/util/logging.cc
@@ -161,6 +161,11 @@ void ArrowLog::UninstallSignalAction() {
   // This signal list comes from glog's signalhandler.cc.
   // https://github.com/google/glog/blob/master/src/signalhandler.cc#L58-L70
   std::vector<int> installed_signals({SIGSEGV, SIGILL, SIGFPE, SIGABRT, 
SIGTERM});
+#ifdef WIN32
+  for (int signal_num : installed_signals) {
+    ARROW_CHECK(signal(signal_num, SIG_DFL) != SIG_ERR);
+  }
+#else
   struct sigaction sig_action;
   memset(&sig_action, 0, sizeof(sig_action));
   sigemptyset(&sig_action.sa_mask);
@@ -169,6 +174,7 @@ void ArrowLog::UninstallSignalAction() {
     ARROW_CHECK(sigaction(signal_num, &sig_action, NULL) == 0);
   }
 #endif
+#endif
 }
 
 void ArrowLog::ShutDownArrowLog() {

Reply via email to