tree-wide: explicitly ignore return value in a couple more places

Resolves:
  - CID#1490777
  - CID#1498366
  - CID#1508639
  - CID#1509084
  - CID#1509086
  - CID#1509087
This commit is contained in:
Frantisek Sumsal
2023-07-02 11:39:00 +02:00
parent 85773a7fd0
commit 5000cea8d2
6 changed files with 8 additions and 8 deletions

View File

@@ -1095,7 +1095,7 @@ pid_t getpid_cached(void) {
* https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c579f48edba88380635ab98cb612030e3ed8691e
*/
__atomic_compare_exchange_n(
(void) __atomic_compare_exchange_n(
&cached_pid,
&current_value,
CACHED_PID_BUSY,

View File

@@ -1013,7 +1013,7 @@ _public_ sd_device *sd_device_get_child_next(sd_device *device, const char **ret
assert(device);
hashmap_iterate(device->children, &device->children_iterator, (void**) &child, (const void**) ret_suffix);
(void) hashmap_iterate(device->children, &device->children_iterator, (void**) &child, (const void**) ret_suffix);
return child;
}

View File

@@ -21,17 +21,17 @@ int main(int argc, char *argv[]) {
x = mkostemp_safe(px);
assert_se(x >= 0);
unlink(px);
(void) unlink(px);
assert_se(fx = mmap_cache_add_fd(m, x, PROT_READ));
y = mkostemp_safe(py);
assert_se(y >= 0);
unlink(py);
(void) unlink(py);
z = mkostemp_safe(pz);
assert_se(z >= 0);
unlink(pz);
(void) unlink(pz);
r = mmap_cache_fd_get(fx, 0, false, 1, 2, NULL, &p);
assert_se(r >= 0);

View File

@@ -419,7 +419,7 @@ static void test_exec_privatetmp(Manager *m) {
test(m, "exec-privatetmp-no.service", 0, CLD_EXITED);
test(m, "exec-privatetmp-disabled-by-prefix.service", can_unshare ? 0 : MANAGER_IS_SYSTEM(m) ? EXIT_FAILURE : EXIT_NAMESPACE, CLD_EXITED);
unlink("/tmp/test-exec_privatetmp");
(void) unlink("/tmp/test-exec_privatetmp");
}
static void test_exec_privatedevices(Manager *m) {

View File

@@ -37,7 +37,7 @@ TEST(sparse_write) {
fd = mkostemp(fn, O_CLOEXEC);
assert_se(fd >= 0);
unlink(fn);
(void) unlink(fn);
test_sparse_write_one(fd, test_a, sizeof(test_a));
test_sparse_write_one(fd, test_b, sizeof(test_b));

View File

@@ -51,7 +51,7 @@ int udev_watch_restore(int inotify_fd) {
assert(inotify_fd >= 0);
rm_rf("/run/udev/watch.old", REMOVE_ROOT);
(void) rm_rf("/run/udev/watch.old", REMOVE_ROOT);
if (rename("/run/udev/watch", "/run/udev/watch.old") < 0) {
if (errno == ENOENT)