You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2021/07/06 12:22:40 UTC
svn commit: r1891310 - /apr/apr/trunk/test/proc_child.c
Author: jorton
Date: Tue Jul 6 12:22:40 2021
New Revision: 1891310
URL: http://svn.apache.org/viewvc?rev=1891310&view=rev
Log:
* test/proc_child.c (main): Avoid gcc -Wunused-result warning with
write() return value.
Modified:
apr/apr/trunk/test/proc_child.c
Modified: apr/apr/trunk/test/proc_child.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/proc_child.c?rev=1891310&r1=1891309&r2=1891310&view=diff
==============================================================================
--- apr/apr/trunk/test/proc_child.c (original)
+++ apr/apr/trunk/test/proc_child.c Tue Jul 6 12:22:40 2021
@@ -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;
}