From: Jim Meyering Date: Mon, 1 Mar 2010 20:26:59 +0000 (+0100) Subject: phypUUIDTable_Push: do not corrupt output stream upon partial write X-Git-Tag: v0.7.7~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23e93d95b5832b4c4890067f0e8867c3bc1fd9d6;p=thirdparty%2Flibvirt.git phypUUIDTable_Push: do not corrupt output stream upon partial write * src/phyp/phyp_driver.c (phypUUIDTable_Push): Move incr/decr of ptr/nread into the loop where those variables are used. Also, remove "exit" label and just-preceding "goto". --- diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 1e8ed3020c..3fc5a0c27e 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -2002,14 +2002,11 @@ phypUUIDTable_Push(virConnectPtr conn) /* rc indicates how many bytes were written this time */ sent += rc; } + ptr += sent; + nread -= sent; } while (rc > 0 && sent < nread); - ptr += sent; - nread -= sent; } while (1); - goto exit; - - exit: if (channel) { libssh2_channel_send_eof(channel); libssh2_channel_wait_eof(channel);