Skip to content

Commit

Permalink
Merge branch 'fsmonitor-fixups'
Browse files Browse the repository at this point in the history
This topic branch contains fixups for v2 of the built-in FSMonitor patch
series (plus a revert of the two PRs in which I had tried earlier to fix
things).

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Jun 9, 2021
2 parents b39873a + cfa0c45 commit 93bbd03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 0 additions & 3 deletions builtin/fsmonitor--daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@ static int do_handle_client(struct fsmonitor_daemon_state *state,
*/
do_flush = 1;
do_trivial = 1;
do_cookie = 1;

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

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

} else {
/*
Expand Down
4 changes: 2 additions & 2 deletions fsmonitor-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int fsmonitor_ipc__send_query(const char *since_token,
trace2_region_enter("fsm_client", "query", NULL);

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

try_again:
state = ipc_client_try_connect(fsmonitor_ipc__get_path(), &options,
Expand All @@ -53,7 +53,7 @@ int fsmonitor_ipc__send_query(const char *since_token,
switch (state) {
case IPC_STATE__LISTENING:
ret = ipc_client_send_command_to_connection(
connection, since_token, since_token ? strlen(since_token) : 0, answer);
connection, since_token, strlen(since_token), answer);
ipc_client_close_connection(connection);

trace2_data_intmax("fsm_client", NULL,
Expand Down
5 changes: 3 additions & 2 deletions fsmonitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,9 @@ void refresh_fsmonitor(struct index_state *istate)
trace_printf_key(&trace_fsmonitor, "refresh fsmonitor");

if (r->settings.use_builtin_fsmonitor > 0) {
query_success = !fsmonitor_ipc__send_query(
istate->fsmonitor_last_update, &query_result);
query_success = istate->fsmonitor_last_update &&
!fsmonitor_ipc__send_query(istate->fsmonitor_last_update,
&query_result);
if (query_success) {
/*
* The response contains a series of nul terminated
Expand Down

0 comments on commit 93bbd03

Please sign in to comment.