Skip to content

Commit b312fa4

Browse files
authored
Merge pull request #3263 from dscho/fix-built-in-fsmonitor
FSMonitor fixes
2 parents 4c20499 + cfa0c45 commit b312fa4

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

builtin/fsmonitor--daemon.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ static int do_handle_client(struct fsmonitor_daemon_state *state,
672672
*/
673673
do_flush = 1;
674674
do_trivial = 1;
675-
do_cookie = 1;
676675

677676
} else if (!skip_prefix(command, "builtin:", &p)) {
678677
/* assume V1 timestamp or garbage */
@@ -686,7 +685,6 @@ static int do_handle_client(struct fsmonitor_daemon_state *state,
686685
"fsmonitor: unsupported V1 protocol '%s'"),
687686
command);
688687
do_trivial = 1;
689-
do_cookie = 1;
690688

691689
} else {
692690
/* We have "builtin:*" */
@@ -696,7 +694,6 @@ static int do_handle_client(struct fsmonitor_daemon_state *state,
696694
"fsmonitor: invalid V2 protocol token '%s'",
697695
command);
698696
do_trivial = 1;
699-
do_cookie = 1;
700697

701698
} else {
702699
/*

fsmonitor-ipc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int fsmonitor_ipc__send_query(const char *since_token,
4444
trace2_region_enter("fsm_client", "query", NULL);
4545

4646
trace2_data_string("fsm_client", NULL, "query/command",
47-
since_token ? since_token : "(null-token)");
47+
since_token);
4848

4949
try_again:
5050
state = ipc_client_try_connect(fsmonitor_ipc__get_path(), &options,
@@ -53,7 +53,7 @@ int fsmonitor_ipc__send_query(const char *since_token,
5353
switch (state) {
5454
case IPC_STATE__LISTENING:
5555
ret = ipc_client_send_command_to_connection(
56-
connection, since_token, since_token ? strlen(since_token) : 0, answer);
56+
connection, since_token, strlen(since_token), answer);
5757
ipc_client_close_connection(connection);
5858

5959
trace2_data_intmax("fsm_client", NULL,

fsmonitor.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@ void refresh_fsmonitor(struct index_state *istate)
290290
trace_printf_key(&trace_fsmonitor, "refresh fsmonitor");
291291

292292
if (r->settings.use_builtin_fsmonitor > 0) {
293-
query_success = !fsmonitor_ipc__send_query(
294-
istate->fsmonitor_last_update, &query_result);
293+
query_success = istate->fsmonitor_last_update &&
294+
!fsmonitor_ipc__send_query(istate->fsmonitor_last_update,
295+
&query_result);
295296
if (query_success) {
296297
/*
297298
* The response contains a series of nul terminated

0 commit comments

Comments
 (0)