From 5201e18a19b66186d77ce14655a192dfd527c098 Mon Sep 17 00:00:00 2001 From: jorton Date: Wed, 5 Jan 2022 16:33:15 +0000 Subject: Merge r1891310 from trunk: * test/proc_child.c (main): Avoid gcc -Wunused-result warning with write() return value. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1896718 13f79535-47bb-0310-9956-ffa450edef68 --- test/proc_child.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/proc_child.c b/test/proc_child.c index 6cfc8fc9f..9f458b9a3 100644 --- a/test/proc_child.c +++ b/test/proc_child.c @@ -11,11 +11,11 @@ int main(void) { char buf[256]; - int bytes; + int bytes, rv = 0; bytes = (int)read(STDIN_FILENO, buf, 256); if (bytes > 0) - write(STDOUT_FILENO, buf, (unsigned int)bytes); + rv = write(STDOUT_FILENO, buf, (unsigned int)bytes) == bytes ? 0 : 1; - return 0; /* just to keep the compiler happy */ + return rv; } -- cgit v1.2.1