diff options
author | Juergen Beisert <jbe@pengutronix.de> | 2014-03-19 12:08:19 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-03-19 14:01:50 +0100 |
commit | 3fb4172ede4201f1e092257103c5c0353bd308c5 (patch) | |
tree | bf7060133021bb5b6bdc416f0771bab9df203279 | |
parent | 8b08f6cf0392c72a1e33d5ef26b5fc194365b1e0 (diff) | |
download | dt-utils-3fb4172ede4201f1e092257103c5c0353bd308c5.tar.gz dt-utils-3fb4172ede4201f1e092257103c5c0353bd308c5.tar.xz |
libdt: error handling: output error messages to stderr
Error handling in scripts cannot work correctly when error messages are
sent to stdout. Send them to stderr instead where they belong to.
To not confuse scripts by debug output, sent this type of messages to stderr as
well.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | src/dt/common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dt/common.h b/src/dt/common.h index 9668c4e..6127bea 100644 --- a/src/dt/common.h +++ b/src/dt/common.h @@ -20,12 +20,12 @@ #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #ifdef DEBUG -#define pr_debug(fmt, arg...) printf(fmt, ##arg) +#define pr_debug(fmt, arg...) fprintf(stderr, fmt, ##arg) #else #define pr_debug(fmt, arg...) #endif -#define pr_err(fmt, arg...) printf(fmt, ##arg) +#define pr_err(fmt, arg...) fprintf(stderr, fmt, ##arg) static inline void *xzalloc(size_t size) { |