From: Dan Fandrich Date: Mon, 18 Mar 2013 22:17:16 +0000 (+0100) Subject: Get rid of a compiler warning with gcc 4.6.3 X-Git-Tag: collectd-5.3.0~23 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a38c24034ce1831ebfaa41ca6231bb15e17086a7;p=collectd.git Get rid of a compiler warning with gcc 4.6.3 ...a futile warning that nevertheless kills the build thanks to -Werror: "variable 'status' set but not used" Signed-off-by: Florian Forster --- diff --git a/src/utils_rrdcreate.c b/src/utils_rrdcreate.c index 3b8f342a..a34e0da0 100644 --- a/src/utils_rrdcreate.c +++ b/src/utils_rrdcreate.c @@ -463,9 +463,8 @@ static int lock_file (char const *filename) /* {{{ */ return (EEXIST); } - errno = 0; status = stat (filename, &sb); - if (errno != ENOENT) + if ((status == 0) || (errno != ENOENT)) { pthread_mutex_unlock (&async_creation_lock); return (EEXIST);