From: Lennart Poettering Date: Tue, 21 Apr 2015 11:21:44 +0000 (+0200) Subject: udevadm: enclose invocation of unlinkat() with a (void) cast X-Git-Tag: v220~374 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=200c7fa6fea5aea301e5b091338c5dc1f88f759c;p=thirdparty%2Fsystemd.git udevadm: enclose invocation of unlinkat() with a (void) cast Let's make Coverity happy about this one. --- diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 352e024a7c6..b3d5565c48b 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -205,17 +205,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); } }