]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:replace: Properly check result of write() and read() (CID 1034925)
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 6 Oct 2023 00:49:43 +0000 (13:49 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 02:18:30 +0000 (02:18 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/replace/tests/testsuite.c

index c0dcda55bd2d106c8515d46280aac6ed02f62375..58624f11eb6559dcd41acc14cac9d34ad1069114 100644 (file)
@@ -854,14 +854,14 @@ static int test_socketpair(void)
                return false;
        }
 
-       if (write(sock[1], "automatisch", 12) == -1) {
+       if (write(sock[1], "automatisch", 12) != 12) {
                printf("failure: socketpair [\n"
                           "write() failed: %s\n"
                           "]\n", strerror(errno));
                return false;
        }
 
-       if (read(sock[0], buf, 12) == -1) {
+       if (read(sock[0], buf, 12) != 12) {
                printf("failure: socketpair [\n"
                           "read() failed: %s\n"
                           "]\n", strerror(errno));