diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:57 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:57 +0000 |
commit | dc50eab76b709d68175a358d6e23a5a3890764d3 (patch) | |
tree | c754d0390db060af0213ff994f0ac310e4cfd6e9 /tools/testing/selftests/uevent | |
parent | Adding debian version 6.6.15-2. (diff) | |
download | linux-dc50eab76b709d68175a358d6e23a5a3890764d3.tar.xz linux-dc50eab76b709d68175a358d6e23a5a3890764d3.zip |
Merging upstream version 6.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/testing/selftests/uevent')
-rw-r--r-- | tools/testing/selftests/uevent/uevent_filtering.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/testing/selftests/uevent/uevent_filtering.c b/tools/testing/selftests/uevent/uevent_filtering.c index 5cebfb3563..dbe55f3a66 100644 --- a/tools/testing/selftests/uevent/uevent_filtering.c +++ b/tools/testing/selftests/uevent/uevent_filtering.c @@ -78,7 +78,7 @@ static int uevent_listener(unsigned long post_flags, bool expect_uevent, { int sk_fd, ret; socklen_t sk_addr_len; - int fret = -1, rcv_buf_sz = __UEVENT_BUFFER_SIZE; + int rcv_buf_sz = __UEVENT_BUFFER_SIZE; uint64_t sync_add = 1; struct sockaddr_nl sk_addr = { 0 }, rcv_addr = { 0 }; char buf[__UEVENT_BUFFER_SIZE] = { 0 }; @@ -121,6 +121,7 @@ static int uevent_listener(unsigned long post_flags, bool expect_uevent, if ((size_t)sk_addr_len != sizeof(sk_addr)) { fprintf(stderr, "Invalid socket address size\n"); + ret = -1; goto on_error; } @@ -147,11 +148,12 @@ static int uevent_listener(unsigned long post_flags, bool expect_uevent, ret = write_nointr(sync_fd, &sync_add, sizeof(sync_add)); close(sync_fd); if (ret != sizeof(sync_add)) { + ret = -1; fprintf(stderr, "Failed to synchronize with parent process\n"); goto on_error; } - fret = 0; + ret = 0; for (;;) { ssize_t r; @@ -187,7 +189,7 @@ static int uevent_listener(unsigned long post_flags, bool expect_uevent, on_error: close(sk_fd); - return fret; + return ret; } int trigger_uevent(unsigned int times) |