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 0/4] tools: iio: Send error messages to stderr
Date: Fri, 10 Jul 2015 13:50:54 +0300 [thread overview]
Message-ID: <cover.1436524490.git.cristina.opriceana@gmail.com> (raw)
This patchset indends to make some cleanup and send printf
error messages to stderr. The changes were performed with coccinelle for
failure messages and manual for other cases. The following script
was used:
@r@
expression e1, e2, stdout;
@@
(printf(e1);
|
printf(e1, e2);
|
fprintf(stdout, e1);
|
fprintf(stdout, e1, e2);
)
@script: python get_string@
e << r.e1;
tdres;
@@
if 'could not' in e.lower() or 'fail' in e.lower() \
or 'problem' in e.lower() or 'not set' in e.lower():
coccinelle.tdres = e
else:
cocci.include_match(False)
@r_match@
expression r.stdout, r.e1, r.e2;
identifier get_string.tdres;
@@
(
- printf(e1);
+ fprintf(stderr, tdres);
|
- printf(e1, e2);
+ fprintf(stderr, tdres, e2);
|
- fprintf(stdout, e1)
+ fprintf(stderr, tdres)
|
- fprintf(stdout, e1, e2)
+ fprintf(stderr, tdres, e2)
)
Changes in v2:
- s/failiure/failure
Cristina Opriceana (4):
tools: iio: Move printf failure messages to stderr
tools: iio: Send usage error messages to stderr
tools: iio: generic_buffer: Maintain fprintf() messages consistent
iio: tools: iio_utils: Move general error messages to stderr
tools/iio/generic_buffer.c | 21 ++++++++++--------
tools/iio/iio_event_monitor.c | 8 +++----
tools/iio/iio_utils.c | 51 +++++++++++++++++++++++++------------------
tools/iio/lsiio.c | 2 +-
4 files changed, 47 insertions(+), 35 deletions(-)
--
1.9.1
next reply other threads:[~2015-07-10 10:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-10 10:50 Cristina Opriceana [this message]
2015-07-10 10:56 ` [PATCH v2 1/4] tools: iio: Move printf failure messages to stderr 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 ` [PATCH v2 4/4] iio: tools: iio_utils: Move general error messages to stderr Cristina Opriceana
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=cover.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.