Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

lua-ev: Fix is_deamon behavior

This fixes an error wherein calling loop_start_watcher with is_daemon ==
-1 would result in a daemonized watcher if it was previously unregistered,
instead of a non-daemonized watcher as documented in the comment (and
makes sense).
  • Loading branch information...
commit 56ed37d94a8bc170d74b27736103d517d65870f0 1 parent 2bdc4c1
@bdowning bdowning authored committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 loop_lua_ev.c
View
8 loop_lua_ev.c
@@ -144,6 +144,14 @@ static void loop_start_watcher(lua_State* L, int loop_i, int watcher_i, int is_d
}
lua_pop(L, 1);
+ if ( is_daemon == -1 ) {
+ /* Set is_daemon properly for -1 case. */
+ if ( current_is_daemon == -1 )
+ is_daemon = 0;
+ else
+ is_daemon = current_is_daemon;
+ }
+
/* Currently not initialized, or daemon status change? */
if ( -1 == current_is_daemon ||
current_is_daemon ^ is_daemon )
Please sign in to comment.
Something went wrong with that request. Please try again.