All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cristina Opriceana <cristina.opriceana@gmail.com>
To: jic23@kernel.org
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	daniel.baluta@intel.com, octavian.purdila@intel.com,
	julia.lawall@lip6.fr
Subject: [PATCH v2 4/4] iio: tools: iio_utils: Move general error messages to stderr
Date: Fri, 10 Jul 2015 14:03:06 +0300	[thread overview]
Message-ID: <f6c10dbb56b34af8c80951e27e880d697781a457.1436524490.git.cristina.opriceana@gmail.com> (raw)
In-Reply-To: <cover.1436524490.git.cristina.opriceana@gmail.com>

This patch replaces stdout general error messages to a more appropriate
standard stream to ensure consistency.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.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


      parent reply	other threads:[~2015-07-10 11:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 10:50 [PATCH v2 0/4] tools: iio: Send error messages to stderr Cristina Opriceana
2015-07-10 10:56 ` [PATCH v2 1/4] tools: iio: Move printf failure " Cristina Opriceana
2015-07-10 21:42   ` Hartmut Knaack
2015-07-12 11:38     ` Cristina Georgiana Opriceana
2015-07-12 12:20       ` Julia Lawall
2015-07-13  9:30         ` Jonathan Cameron
2015-07-12 13:07       ` Hartmut Knaack
2015-07-12 13:57         ` Cristina Georgiana Opriceana
2015-07-13  9:36         ` Jonathan Cameron
2015-07-10 10:59 ` [PATCH v2 2/4] tools: iio: Send usage error " Cristina Opriceana
2015-07-10 11:01 ` [PATCH v2 3/4] tools: iio: generic_buffer: Maintain fprintf() messages consistent Cristina Opriceana
2015-07-10 11:03 ` Cristina Opriceana [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6c10dbb56b34af8c80951e27e880d697781a457.1436524490.git.cristina.opriceana@gmail.com \
    --to=cristina.opriceana@gmail.com \
    --cc=daniel.baluta@intel.com \
    --cc=jic23@kernel.org \
    --cc=julia.lawall@lip6.fr \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=octavian.purdila@intel.com \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.