From: Davin McCall Date: Sat, 3 Feb 2018 18:38:48 +0000 (+0000) Subject: Fix error in control protocol implementation in dinitctl/shutdown. X-Git-Tag: v0.08~3 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1fb468f7cefdbd1fac102d29c20ea6ffc8302f36;p=oweals%2Fdinit.git Fix error in control protocol implementation in dinitctl/shutdown. --- diff --git a/src/dinitctl.cc b/src/dinitctl.cc index 014e8c2..8fa0ed9 100644 --- a/src/dinitctl.cc +++ b/src/dinitctl.cc @@ -82,7 +82,7 @@ static void wait_for_reply(cpbuffer<1024> &rbuffer, int fd) while (rbuffer[0] >= 100) { // Information packet; discard. - fillBufferTo(&rbuffer, fd, 1); + fillBufferTo(&rbuffer, fd, 2); int pktlen = (unsigned char) rbuffer[1]; rbuffer.consume(1); // Consume one byte so we'll read one byte of the next packet diff --git a/src/shutdown.cc b/src/shutdown.cc index 4d4577f..c751fd0 100644 --- a/src/shutdown.cc +++ b/src/shutdown.cc @@ -215,7 +215,7 @@ static void wait_for_reply(cpbuffer<1024> &rbuffer, int fd) while (rbuffer[0] >= 100) { // Information packet; discard. - fillBufferTo(&rbuffer, fd, 1); + fillBufferTo(&rbuffer, fd, 2); int pktlen = (unsigned char) rbuffer[1]; rbuffer.consume(1); // Consume one byte so we'll read one byte of the next packet