Skip to content

Commit

Permalink
groonga: add missing defined(WIN32) check for log reopen by signal
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed May 27, 2022
1 parent 41d09a6 commit 1760ffc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/groonga.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@
# include <sys/uio.h>
#endif /* WIN32 */

#ifdef HAVE_SIGNAL_H
#if !defined(WIN32) && defined(HAVE_SIGNAL_H)
# define ENABLE_LOG_REOPEN_BY_SIGNAL
#endif

#ifdef ENABLE_LOG_REOPEN_BY_SIGNAL
# include <signal.h>
#endif

Expand Down Expand Up @@ -115,7 +119,7 @@ static grn_wal_role worker_wal_role = GRN_WAL_ROLE_NONE;

static grn_bool running_event_loop = GRN_FALSE;

#ifdef HAVE_SIGNAL_H
#ifdef ENABLE_LOG_REOPEN_BY_SIGNAL
static bool usr1_received = false;

static void
Expand Down Expand Up @@ -1109,7 +1113,7 @@ run_server_loop(grn_ctx *ctx, grn_com_event *ev)
running_event_loop = GRN_TRUE;
while (!grn_com_event_poll(ctx, ev, request_timer_get_poll_timeout()) &&
grn_gctx.stat != GRN_CTX_QUIT) {
#ifdef HAVE_SIGNAL_H
#ifdef ENABLE_LOG_REOPEN_BY_SIGNAL
reopen_log_by_signal(ctx);
#endif
grn_edge *edge;
Expand Down Expand Up @@ -4607,7 +4611,7 @@ main(int argc, char **argv)
grn_set_segv_handler();
grn_set_int_handler();
grn_set_term_handler();
#ifdef HAVE_SIGNAL_H
#ifdef ENABLE_LOG_REOPEN_BY_SIGNAL
set_usr1_handler();
#endif

Expand Down

0 comments on commit 1760ffc

Please sign in to comment.