From af5c091002038378100845d3602fcc7378c8db47 Mon Sep 17 00:00:00 2001 From: Matthieu Nottale Date: Fri, 2 Sep 2016 14:26:42 +0200 Subject: [PATCH] Send error logs to stderr. --- miniupnpc/connecthostport.c | 2 +- miniupnpc/minisoap.c | 2 +- miniupnpc/minissdpc.c | 2 +- miniupnpc/receivedata.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/miniupnpc/connecthostport.c b/miniupnpc/connecthostport.c index 5185e13..d28aaf5 100644 --- a/miniupnpc/connecthostport.c +++ b/miniupnpc/connecthostport.c @@ -42,7 +42,7 @@ /* definition of PRINT_SOCKET_ERROR */ #ifdef _WIN32 -#define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); +#define PRINT_SOCKET_ERROR(x) fprintf(stderr, "Socket error: %s, %d\n", x, WSAGetLastError()); #else #define PRINT_SOCKET_ERROR(x) perror(x) #endif diff --git a/miniupnpc/minisoap.c b/miniupnpc/minisoap.c index 5c9a114..76225f4 100644 --- a/miniupnpc/minisoap.c +++ b/miniupnpc/minisoap.c @@ -25,7 +25,7 @@ #include #ifdef _WIN32 -#define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); +#define PRINT_SOCKET_ERROR(x) fprintf(stderr, "Socket error: %s, %d\n", x, WSAGetLastError()); #else #define PRINT_SOCKET_ERROR(x) perror(x) #endif diff --git a/miniupnpc/minissdpc.c b/miniupnpc/minissdpc.c index 25640f3..8eee2e9 100644 --- a/miniupnpc/minissdpc.c +++ b/miniupnpc/minissdpc.c @@ -62,7 +62,7 @@ struct sockaddr_un { #endif #ifdef _WIN32 -#define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); +#define PRINT_SOCKET_ERROR(x) fprintf(stderr, "Socket error: %s, %d\n", x, WSAGetLastError()); #else #define PRINT_SOCKET_ERROR(x) perror(x) #endif diff --git a/miniupnpc/receivedata.c b/miniupnpc/receivedata.c index ef85a3d..d003eb6 100644 --- a/miniupnpc/receivedata.c +++ b/miniupnpc/receivedata.c @@ -28,7 +28,7 @@ #endif /* _WIN32 */ #ifdef _WIN32 -#define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); +#define PRINT_SOCKET_ERROR(x) fprintf(stderr, "Socket error: %s, %d\n", x, WSAGetLastError()); #else #define PRINT_SOCKET_ERROR(x) perror(x) #endif