summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2022-01-05 16:33:15 +0000
committerJoe Orton <jorton@apache.org>2022-01-05 16:33:15 +0000
commit57df6dda54fad57d814d0debc0feb018964c7744 (patch)
tree13f715f0952e3b81b2648af9530c1b6120b4d3b8
parentea6dad9f9a9a91bc457f38815fe5f686f178aac5 (diff)
downloadapr-57df6dda54fad57d814d0debc0feb018964c7744.tar.gz
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
-rw-r--r--test/proc_child.c6
1 files 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;
}