From: Florian Forster Date: Thu, 3 Jul 2008 09:17:59 +0000 (+0200) Subject: src/rrd_client.c: Close the socket if writing to it fails. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=08de4f55d4548ce042d43d99f209e266568523f5;p=rrdtool.git src/rrd_client.c: Close the socket if writing to it fails. --- diff --git a/src/rrd_client.c b/src/rrd_client.c index d9a7468..f1253f8 100644 --- a/src/rrd_client.c +++ b/src/rrd_client.c @@ -99,7 +99,11 @@ static ssize_t swrite (const void *buf, size_t count) /* {{{ */ continue; if (status < 0) + { + close (sd); + sd = -1; return (status); + } nleft = nleft - status; ptr = ptr + status;