Skip to content

Commit

Permalink
tests: Print context creation messages to stderr
Browse files Browse the repository at this point in the history
When using iio_readdev, stdout is reserved for the data output; so
information messages about the context creation must be sent to stderr
so that the data stream is not polluted.

Fixes #583.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Apr 9, 2021
1 parent 720b11e commit 8f53a94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/iio_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ struct iio_context * autodetect_context(bool rtn, const char * name, const char
}

if (ret == 0) {
printf("No IIO context found.\n");
fprintf(stderr, "No IIO context found.\n");
goto err_free_info_list;
}
if (rtn && ret == 1) {
printf("Using auto-detected IIO context at URI \"%s\"\n",
fprintf(stderr, "Using auto-detected IIO context at URI \"%s\"\n",
iio_context_info_get_uri(info[0]));
ctx = iio_create_context_from_uri(iio_context_info_get_uri(info[0]));
} else {
Expand Down

0 comments on commit 8f53a94

Please sign in to comment.