From: Lennart Poettering Date: Wed, 3 Sep 2008 16:29:49 +0000 (+0200) Subject: fix misuse of return value X-Git-Tag: 1.0_branch~2677 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f931138d2445691e7e97d237e1db183d0dabfb7;p=profile%2Fivi%2Fpulseaudio.git fix misuse of return value --- diff --git a/src/tests/parec-simple.c b/src/tests/parec-simple.c index 0312005..c9d3bef 100644 --- a/src/tests/parec-simple.c +++ b/src/tests/parec-simple.c @@ -72,7 +72,6 @@ int main(int argc, char*argv[]) { for (;;) { uint8_t buf[BUFSIZE]; - ssize_t r; /* Record some data ... */ if (pa_simple_read(s, buf, sizeof(buf), &error) < 0) { @@ -80,11 +79,8 @@ int main(int argc, char*argv[]) { goto finish; } - if (r == 0) - break; - /* And write it to STDOUT */ - if ((r = loop_write(STDOUT_FILENO, buf, sizeof(buf))) <= 0) { + if (loop_write(STDOUT_FILENO, buf, sizeof(buf)) != sizeof(buf)) { fprintf(stderr, __FILE__": write() failed: %s\n", strerror(errno)); goto finish; }