[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <765ac5d5ecc396989d31ae49708cf990eef90848.1436220932.git.cristina.opriceana@gmail.com>
Date: Tue, 7 Jul 2015 01:55:06 +0300
From: Cristina Opriceana <cristina.opriceana@...il.com>
To: jic23@...nel.org
Cc: knaack.h@....de, lars@...afoo.de, pmeerw@...erw.net,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
daniel.baluta@...el.com, octavian.purdila@...el.com,
julia.lawall@...6.fr
Subject: [PATCH 4/4] tools: iio: iio_utils: Move general error messages to
stderr
This patch replaces stdout general error messages to a more appropriate
standard stream to ensure consistency.
Signed-off-by: Cristina Opriceana <cristina.opriceana@...il.com>
---
tools/iio/iio_utils.c | 17 ++++++++++-------
tools/iio/lsiio.c | 2 +-
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
index 46dfa3f..8b218bd 100644
--- a/tools/iio/iio_utils.c
+++ b/tools/iio/iio_utils.c
@@ -158,7 +158,8 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
goto error_close_sysfsfp;
} else if (ret != 5) {
ret = -EIO;
- printf("scan type description didn't match\n");
+ fprintf(stderr,
+ "scan type description didn't match\n");
goto error_close_sysfsfp;
}
@@ -572,7 +573,7 @@ int find_type_by_name(const char *name, const char *type)
dp = opendir(iio_dir);
if (dp == NULL) {
- printf("No industrialio devices available\n");
+ fprintf(stderr, "No industrialio devices available\n");
return -ENODEV;
}
@@ -709,8 +710,9 @@ static int _write_sysfs_int(const char *filename, const char *basedir, int val,
}
if (test != val) {
- printf("Possible failure in int write %d to %s/%s\n",
- val, basedir, filename);
+ fprintf(stderr,
+ "Possible failure in int write %d to %s/%s\n",
+ val, basedir, filename);
ret = -1;
}
}
@@ -806,9 +808,10 @@ static int _write_sysfs_string(const char *filename, const char *basedir,
}
if (strcmp(temp, val) != 0) {
- printf("Possible failure in string write of %s "
- "Should be %s written to %s/%s\n", temp, val,
- basedir, filename);
+ fprintf(stderr,
+ "Possible failure in string write of %s "
+ "Should be %s written to %s/%s\n", temp, val,
+ basedir, filename);
ret = -1;
}
}
diff --git a/tools/iio/lsiio.c b/tools/iio/lsiio.c
index 7f432a5..31996de 100644
--- a/tools/iio/lsiio.c
+++ b/tools/iio/lsiio.c
@@ -108,7 +108,7 @@ static int dump_devices(void)
dp = opendir(iio_dir);
if (dp == NULL) {
- printf("No industrial I/O devices available\n");
+ fprintf(stderr, "No industrial I/O devices available\n");
return -ENODEV;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists