Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1177951

[PATCH 0/4] tools: iio: Send error messages to stderr

From Cristina Opriceana <cristina.opriceana@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 0/4] tools: iio: Send error messages to stderr
Date 2015-07-07 00:50 +0200
Message-ID <pJnn4-5RR-19@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This patchset indends to make some cleanup and send printf
error messages to stderr.
The changes were performed with coccinelle for failiure
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)
)

Cristina Opriceana (4):
  tools: iio: Move printf failiure messages to stderr
  tools: iio: Send usage error messages to stderr
  tools: iio: generic_buffer: Maintain fprintf() messages consistent
  tools: iio: 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] tools: iio: Send error messages to stderr Cristina Opriceana <cristina.opriceana@gmail.com> - 2015-07-07 00:50 +0200
  [PATCH 4/4] tools: iio: iio_utils: Move general error messages to  stderr Cristina Opriceana <cristina.opriceana@gmail.com> - 2015-07-07 01:00 +0200
  [PATCH 1/4] tools: iio: Move printf failiure messages to stderr Cristina Opriceana <cristina.opriceana@gmail.com> - 2015-07-07 01:00 +0200
  [PATCH 2/4] tools: iio: Send usage error messages to stderr Cristina Opriceana <cristina.opriceana@gmail.com> - 2015-07-07 01:00 +0200
  [PATCH 3/4] tools: iio: generic_buffer: Maintain fprintf() messages  consistent Cristina Opriceana <cristina.opriceana@gmail.com> - 2015-07-07 01:00 +0200

csiph-web