diff mbox

libibmad: libibumad: Print warnings and errors to stderr not stdout

Message ID 20091117143810.81ade4b4.weiny2@llnl.gov (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ira Weiny Nov. 17, 2009, 10:38 p.m. UTC
None
diff mbox

Patch

diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h
index ed8fd71..9347bc2 100644
--- a/libibmad/include/infiniband/mad.h
+++ b/libibmad/include/infiniband/mad.h
@@ -1018,11 +1018,11 @@  static inline uint64_t htonll(uint64_t x)
 #define ALIGN(l, size) (((l) + ((size) - 1)) / (size) * (size))
 
 /** printf style warning MACRO, includes name of function and pid */
-#define IBWARN(fmt, ...) fprintf(stdout, "ibwarn: [%d] %s: " fmt "\n", getpid(), __func__, ## __VA_ARGS__)
+#define IBWARN(fmt, ...) fprintf(stderr, "ibwarn: [%d] %s: " fmt "\n", getpid(), __func__, ## __VA_ARGS__)
 
 /** printf style abort MACRO, includes name of function and pid */
 #define IBPANIC(fmt, ...) do { \
-	fprintf(stdout, "ibpanic: [%d] %s: " fmt ": %m\n", getpid(), __func__, ## __VA_ARGS__); \
+	fprintf(stderr, "ibpanic: [%d] %s: " fmt ": %m\n", getpid(), __func__, ## __VA_ARGS__); \
 	exit(-1); \
 } while(0)
 
diff --git a/libibumad/src/umad.c b/libibumad/src/umad.c
index cdf6b46..277ae6b 100644
--- a/libibumad/src/umad.c
+++ b/libibumad/src/umad.c
@@ -83,7 +83,7 @@  extern int sys_read_gid(char *dir_name, char *file_name, uint8_t * gid);
 extern int sys_read_uint64(char *dir_name, char *file_name, uint64_t * u);
 extern int sys_read_uint(char *dir_name, char *file_name, unsigned *u);
 
-#define IBWARN(fmt, args...) fprintf(stdout, "ibwarn: [%d] %s: " fmt "\n", getpid(), __func__, ## args)
+#define IBWARN(fmt, args...) fprintf(stderr, "ibwarn: [%d] %s: " fmt "\n", getpid(), __func__, ## args)
 
 #define TRACE	if (umaddebug)	IBWARN
 #define DEBUG	if (umaddebug)	IBWARN