Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSMonitor fixes #3263

Merged
merged 5 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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