summaryrefslogtreecommitdiffstats
path: root/src/common/safe_io.c
diff options
context:
space:
mode:
authorNoah Watkins <noahwatkins@gmail.com>2014-02-23 20:14:00 +0100
committerNoah Watkins <noahwatkins@gmail.com>2014-02-23 20:17:42 +0100
commit0e376ee74251417ff13ba3e1629b75d973b23ee8 (patch)
tree41189a77d9ca2568a47e626de4831b5a2f96819d /src/common/safe_io.c
parentMerge pull request #1287 from kdreyer-inktank/redhat-files (diff)
downloadceph-0e376ee74251417ff13ba3e1629b75d973b23ee8.tar.xz
ceph-0e376ee74251417ff13ba3e1629b75d973b23ee8.zip
compat: avoid unused warn with TEMP_FAILURE_RETRY
The version of TEMP_FAILURE_RETRY found on Linux has a GNU extension that squashes the unused return value warning where applicable. This adds a VOID_TEMP_FAILURE_RETRY to make the case explicit, casting the expression value to void to avoid the warning. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Diffstat (limited to 'src/common/safe_io.c')
-rw-r--r--src/common/safe_io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/safe_io.c b/src/common/safe_io.c
index 0b31157cd51..49223497281 100644
--- a/src/common/safe_io.c
+++ b/src/common/safe_io.c
@@ -175,13 +175,13 @@ int safe_write_file(const char *base, const char *file,
}
ret = safe_write(fd, val, vallen);
if (ret) {
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
return ret;
}
ret = fsync(fd);
if (ret < 0) ret = -errno;
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
if (ret < 0) {
unlink(tmp);
return ret;
@@ -200,7 +200,7 @@ int safe_write_file(const char *base, const char *file,
}
ret = fsync(fd);
if (ret < 0) ret = -errno;
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
return ret;
}
@@ -218,11 +218,11 @@ int safe_read_file(const char *base, const char *file,
}
len = safe_read(fd, val, vallen - 1);
if (len < 0) {
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
return len;
}
// close sometimes returns errors, but only after write()
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
val[len] = 0;
return len;