mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
lib:replace: Properly check result of write() and read() (CID 1034925)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
fe86989fcc
commit
8f4aa3508c
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user