Re: [PATCH v14 15/21] index-helper: kill mode
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 6, 2016, 08:20 UTC
- Message-ID
- <alpine.DEB.2.20.1607061016330.6426@virtualbox>
- In-Reply-To
- <1467532693-20017-16-git-send-email-novalis@novalis.org>
Hi Dave,
On Sun, 3 Jul 2016, David Turner wrote:
Show 10 quoted lines
> @@ -357,10 +359,29 @@ static const char * const usage_text[] = {
> NULL
> };
>
> +static void request_kill(void)
> +{
> + int fd = unix_stream_connect(git_path("index-helper.sock"));
> +
> + if (fd >= 0) {
> + write_in_full(fd, "die", 4);I believe that this is incorrect. When I interrupt t7900 after the 3rd test case, it says
fatal: protocol error: bad line length character: die
twice, suggesting that this write_in_full() actually needs to be a packet_write(fd, "die") instead, seeing as loop() uses the packet_read() call to read the messages.
BTW I am in the middle of trying to abstract out a "simple server" that will allow me to back the inter-process communication by a pure Windows solution (named pipes) instead of the Unix sockets. It turns out to be much more difficult than I hoped: the code is really relying on Unix sockets currently.
Will keep you posted, Dscho