Skip to content

Commit

Permalink
cleanup: exit uncleanly if priv helper not found
Browse files Browse the repository at this point in the history
  • Loading branch information
abower-amd committed Nov 18, 2024
1 parent 4fa3208 commit eb0c605
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sfptpd_priv.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ static int sfptpd_priv_rpc(struct sfptpd_priv_state *state,
return num_fds;
}

static bool priv_sync(struct sfptpd_priv_state *state)
static int priv_sync(struct sfptpd_priv_state *state)
{
struct sfptpd_priv_req_msg req = { .req = SFPTPD_PRIV_REQ_SYNC };
struct sfptpd_priv_resp_msg resp = { 0 };

return sfptpd_priv_rpc(state, &req, &resp, NULL) == 0;
return sfptpd_priv_rpc(state, &req, &resp, NULL);
}


Expand Down Expand Up @@ -307,10 +307,10 @@ int sfptpd_priv_start_helper(struct sfptpd_config *config, int *pid)
return -rc;
}

if (!priv_sync(state)) {
if ((rc = priv_sync(state)) < 0) {
sfptpd_priv_stop_helper();
CRITICAL("could not start privileged helper\n");
return -ESHUTDOWN;
return rc;
} else {
TRACE_L3("priv: started helper\n");
}
Expand Down

0 comments on commit eb0c605

Please # to comment.