summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-04-25 20:53:29 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-04-25 21:50:48 -0400
commit2a371001f8d23533a339a150eeffa3215773058d (patch)
tree158295689f5a089c643f6bee57cc1ee9fa9a78b3 /src/shared
parente0a974b471cced122a91f03b3f635a6dd89e1499 (diff)
Use attribute(unused) in PROTECT_ERRNO
clang emits warnings about unused attribute _saved_errno_, which drown out other—potentially useful—warnings. gcc documentation is not exactly verbose about the effects of __attribute__((unused)) on variables, but let's assume that it works if the unit test passes.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/cgroup-util.c1
-rw-r--r--src/shared/util.h2
2 files changed, 1 insertions, 2 deletions
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index b79a24a495..46a8128eb4 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -1208,7 +1208,6 @@ int cg_pid_get_path_shifted(pid_t pid, char **root, char **cgroup) {
}
int cg_path_decode_unit(const char *cgroup, char **unit){
- _cleanup_free_ char *unescaped = NULL;
char *p, *e, *c, *s, *k;
assert(cgroup);
diff --git a/src/shared/util.h b/src/shared/util.h
index 68e87da7cd..e3fc876857 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -644,7 +644,7 @@ static inline void _reset_errno_(int *saved_errno) {
errno = *saved_errno;
}
-#define PROTECT_ERRNO _cleanup_(_reset_errno_) int _saved_errno_ = errno
+#define PROTECT_ERRNO _cleanup_(_reset_errno_) __attribute__((unused)) int _saved_errno_ = errno
struct _umask_struct_ {
mode_t mask;