summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-21 13:21:44 +0200
committerAnthony G. Basile <blueness@gentoo.org>2015-05-03 14:42:35 -0400
commit6534505be742b9de1711403ef7ccda0f389dafea (patch)
treeedd600a35eb7f220f63399ab7fc5ee5cae8b0a9e
parent5d4ffb7b7ebaf88b715f03239c32c07a0f61d3b8 (diff)
udevadm: enclose invocation of unlinkat() with a (void) cast
Let's make Coverity happy about this one. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--src/udev/udevadm-info.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c
index 5e86856142..3846f8f7b0 100644
--- a/src/udev/udevadm-info.c
+++ b/src/udev/udevadm-info.c
@@ -208,17 +208,15 @@ static void cleanup_dir(DIR *dir, mode_t mask, int depth) {
if ((stats.st_mode & mask) != 0)
continue;
if (S_ISDIR(stats.st_mode)) {
- DIR *dir2;
+ _cleanup_closedir_ DIR *dir2;
dir2 = fdopendir(openat(dirfd(dir), dent->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC));
- if (dir2 != NULL) {
+ if (dir2 != NULL)
cleanup_dir(dir2, mask, depth-1);
- closedir(dir2);
- }
- unlinkat(dirfd(dir), dent->d_name, AT_REMOVEDIR);
- } else {
- unlinkat(dirfd(dir), dent->d_name, 0);
- }
+
+ (void) unlinkat(dirfd(dir), dent->d_name, AT_REMOVEDIR);
+ } else
+ (void) unlinkat(dirfd(dir), dent->d_name, 0);
}
}