[PATCH c-hglib] hg_exitcode: reset the bytes_on_pipe after finish the read

Iulian Stana julian.stana at gmail.com
Mon Sep 23 14:43:41 CDT 2013


# HG changeset patch
# User Iulian Stana <julian.stana at gmail.com>
# Date 1379964910 -10800
#      Mon Sep 23 22:35:10 2013 +0300
# Node ID 0f979fbe86d000fad5f1807cfe7008d034c71483
# Parent  43bbd8b7a56b5a321bf073246225672ad7402461
hg_exitcode: reset the bytes_on_pipe after finish the read

There was a bug. After each reading you must deacrese the number of
bytes_on_pipe field. And I forgot to decrease this field in exitcode function.

diff --git a/hglib/client.c b/hglib/client.c
--- a/hglib/client.c
+++ b/hglib/client.c
@@ -310,6 +310,7 @@
 	if (read(handle->p_read, &exitcode, sizeof(int)) < 0) {
 		return -1;
 	}
+	handle->bytes_on_pipe = 0;
 	handle->protect = 0;
 	return swap_uint32(exitcode);
 }


More information about the Mercurial-devel mailing list