summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2022-01-05 16:33:15 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2022-01-05 16:33:15 +0000
commit5201e18a19b66186d77ce14655a192dfd527c098 (patch)
tree13f715f0952e3b81b2648af9530c1b6120b4d3b8
parent689244d44265e59e7691bb5850524ea6b422dc19 (diff)
downloadlibapr-5201e18a19b66186d77ce14655a192dfd527c098.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;
}