summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}