Skip to content

Commit

Permalink
tests: iio_writedev: print error regardless of 'app_running'
Browse files Browse the repository at this point in the history
We should print an error message regardless of whether app_running is
true/false. Otherwise we risk hiding errors.

Signed-off-by: Cristi Iacob <[email protected]>
  • Loading branch information
cristi-iacob authored and commodo committed Apr 16, 2020
1 parent db9e246 commit d957407
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/iio_writedev.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,9 @@ int main(int argc, char **argv)

int ret = iio_buffer_push(buffer);
if (ret < 0) {
if (app_running) {
char buf[256];
iio_strerror(-ret, buf, sizeof(buf));
fprintf(stderr, "Unable to push buffer: %s\n", buf);
}
char buf[256];
iio_strerror(-ret, buf, sizeof(buf));
fprintf(stderr, "Unable to push buffer: %s\n", buf);
break;
}

Expand Down

0 comments on commit d957407

Please sign in to comment.