Skip to content

Commit 8f53a94

Browse files
committed
tests: Print context creation messages to stderr
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]>
1 parent 720b11e commit 8f53a94

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/iio_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ struct iio_context * autodetect_context(bool rtn, const char * name, const char
9595
}
9696

9797
if (ret == 0) {
98-
printf("No IIO context found.\n");
98+
fprintf(stderr, "No IIO context found.\n");
9999
goto err_free_info_list;
100100
}
101101
if (rtn && ret == 1) {
102-
printf("Using auto-detected IIO context at URI \"%s\"\n",
102+
fprintf(stderr, "Using auto-detected IIO context at URI \"%s\"\n",
103103
iio_context_info_get_uri(info[0]));
104104
ctx = iio_create_context_from_uri(iio_context_info_get_uri(info[0]));
105105
} else {

0 commit comments

Comments
 (0)