Skip to content

Commit cbd0a18

Browse files
committed
* 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/trunk@1891310 13f79535-47bb-0310-9956-ffa450edef68
1 parent 3b20d3d commit cbd0a18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/proc_child.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
int main(void)
1212
{
1313
char buf[256];
14-
int bytes;
14+
int bytes, rv = 0;
1515

1616
bytes = (int)read(STDIN_FILENO, buf, 256);
1717
if (bytes > 0)
18-
write(STDOUT_FILENO, buf, (unsigned int)bytes);
18+
rv = write(STDOUT_FILENO, buf, (unsigned int)bytes) == bytes ? 0 : 1;
1919

20-
return 0; /* just to keep the compiler happy */
20+
return rv;
2121
}

0 commit comments

Comments
 (0)