Skip to content

Commit

Permalink
dinitctl: wait for service state via v5 or original service event
Browse files Browse the repository at this point in the history
Respond to both SERVICEEVENT5 (protocol v5) or original SERVICEEVENT
when waiting for a service to reach a started/stopped state. The v5 info
packet should arrive first (assuming new dinit daemon) and has more
information, so will display better status info.
  • Loading branch information
davmac314 committed Oct 1, 2024
1 parent d8291e4 commit 6a854d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dinitctl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ static int wait_service_state(int socknum, cpbuffer_t &rbuffer, handle_t handle,
unsigned pktlen = (unsigned char) rbuffer[1];
fill_buffer_to(rbuffer, socknum, pktlen);

if (rbuffer[0] == (char)cp_info::SERVICEEVENT) {
if (value((cp_info)rbuffer[0]).is_in(cp_info::SERVICEEVENT, cp_info::SERVICEEVENT5)) {
int ret = process_service_event(rbuffer, pktlen, handle, service_name, do_stop, verbose);
if (ret >= 0) {
return ret;
Expand Down

0 comments on commit 6a854d3

Please sign in to comment.