Get rid of a compiler warning with gcc 4.6.3
authorDan Fandrich <dan@coneharvesters.com>
Mon, 18 Mar 2013 22:17:16 +0000 (23:17 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 23 Mar 2013 09:19:01 +0000 (10:19 +0100)
...a futile warning that nevertheless kills the build thanks
to -Werror: "variable 'status' set but not used"

Signed-off-by: Florian Forster <octo@collectd.org>
src/utils_rrdcreate.c

index 3b8f342..a34e0da 100644 (file)
@@ -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);