From: Florian Forster Date: Tue, 24 Jun 2008 19:04:01 +0000 (+0200) Subject: src/rrd_client.c: Remove useless `FILE *sh;'. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=537c362313f6174f43090aa5dda299582c30cc6f;p=rrdtool.git src/rrd_client.c: Remove useless `FILE *sh;'. --- diff --git a/src/rrd_client.c b/src/rrd_client.c index eace81c..4449a01 100644 --- a/src/rrd_client.c +++ b/src/rrd_client.c @@ -34,9 +34,6 @@ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static int sd = -1; -#if 0 -static FILE *sh; -#endif static ssize_t sread (void *buffer_void, size_t buffer_size) /* {{{ */ { @@ -62,9 +59,6 @@ static ssize_t sread (void *buffer_void, size_t buffer_size) /* {{{ */ { close (sd); sd = -1; -#if 0 - sh = NULL; -#endif errno = EPROTO; return (-1); } @@ -215,18 +209,6 @@ static int rrdc_connect_unix (const char *path) /* {{{ */ return (status); } -#if 0 - sh = fdopen (sd, "w+"); - if (sh == NULL) - { - status = errno; - close (sd); - sd = -1; - pthread_mutex_unlock (&lock); - return (status); - } -#endif - pthread_mutex_unlock (&lock); return (0); @@ -290,17 +272,6 @@ int rrdc_connect (const char *addr) /* {{{ */ continue; } -#if 0 - sh = fdopen (sd, "w+"); - if (sh == NULL) - { - status = errno; - close (sd); - sd = -1; - continue; - } -#endif - assert (status == 0); break; } /* for (ai_ptr) */ @@ -311,30 +282,20 @@ int rrdc_connect (const char *addr) /* {{{ */ int rrdc_disconnect (void) /* {{{ */ { - int status; - pthread_mutex_lock (&lock); if (sd < 0) { pthread_mutex_unlock (&lock); - return (-1); + return (0); } -#if 0 - status = fclose (sh); - if (status != 0) - status = errno; - - sh = NULL; -#else - status = 0; -#endif + close (sd); sd = -1; pthread_mutex_unlock (&lock); - return (status); + return (0); } /* }}} int rrdc_disconnect */ int rrdc_update (const char *filename, int values_num, /* {{{ */ @@ -403,7 +364,7 @@ int rrdc_update (const char *filename, int values_num, /* {{{ */ status = atoi (buffer); return (status); -} /* }}} int rrd_update_daemon */ +} /* }}} int rrdc_update */ int rrdc_flush (const char *filename) /* {{{ */ {