tree-wide: assorted coccinelle fixes

This commit is contained in:
Frantisek Sumsal
2020-10-09 15:02:23 +02:00
parent 44e66de0f2
commit d7a0f1f4f9
56 changed files with 351 additions and 399 deletions
+1 -2
View File
@@ -285,8 +285,7 @@ static void* client1(void *p) {
assert_se(streq(hello, "hello"));
if (pipe2(pp, O_CLOEXEC|O_NONBLOCK) < 0) {
log_error_errno(errno, "Failed to allocate pipe: %m");
r = -errno;
r = log_error_errno(errno, "Failed to allocate pipe: %m");
goto finish;
}
+1 -2
View File
@@ -548,10 +548,9 @@ static void test_pidfd(void) {
assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD, -1) >= 0);
pid = fork();
if (pid == 0) {
if (pid == 0)
/* child */
_exit(66);
}
assert_se(pid > 1);
+4 -4
View File
@@ -343,10 +343,10 @@ _public_ int sd_hwdb_new(sd_hwdb **ret) {
return log_debug_errno(errno, "Failed to map %s: %m", hwdb_bin_path);
if (memcmp(hwdb->map, sig, sizeof(hwdb->head->signature)) != 0 ||
(size_t) hwdb->st.st_size != le64toh(hwdb->head->file_size)) {
log_debug("Failed to recognize the format of %s", hwdb_bin_path);
return -EINVAL;
}
(size_t) hwdb->st.st_size != le64toh(hwdb->head->file_size))
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
"Failed to recognize the format of %s",
hwdb_bin_path);
log_debug("=== trie on-disk ===");
log_debug("tool version: %"PRIu64, le64toh(hwdb->head->tool_version));
+1 -1
View File
@@ -139,7 +139,7 @@ static void test_route(sd_netlink *rtnl) {
return;
}
addr.s_addr = htonl(INADDR_LOOPBACK);
addr.s_addr = htobe32(INADDR_LOOPBACK);
r = sd_netlink_message_append_in_addr(req, RTA_GATEWAY, &addr);
if (r < 0) {
+1 -1
View File
@@ -63,7 +63,7 @@ int main(int argc, char *argv[]) {
struct sockaddr_in sa = {
.sin_family = AF_INET,
.sin_port = htons(80)
.sin_port = htobe16(80)
};
assert_se(sd_resolve_default(&resolve) >= 0);