From bcb5f90ee6b4bb1fe9c7dded34d8d70926307128 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 11 Aug 2014 09:19:23 +0200 Subject: [PATCH] Replaced perror with DEBUG_WARN --- libfreerdp/core/listener.c | 18 +++++++++--------- libfreerdp/core/nla.c | 4 ++-- libfreerdp/core/tcp.c | 10 +++++----- libfreerdp/utils/pcap.c | 2 +- libfreerdp/utils/tcp.c | 6 +++--- libfreerdp/utils/uds.c | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libfreerdp/core/listener.c b/libfreerdp/core/listener.c index a2163b355..57ee3d6ec 100644 --- a/libfreerdp/core/listener.c +++ b/libfreerdp/core/listener.c @@ -104,7 +104,7 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a #ifdef _WIN32 _tprintf(_T("getaddrinfo error: %s\n"), gai_strerror(status)); #else - perror("getaddrinfo"); + DEBUG_WARN("getaddrinfo"); #endif return FALSE; } @@ -118,14 +118,14 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a if (sockfd == -1) { - perror("socket"); + DEBUG_WARN("socket"); continue; } option_value = 1; if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (void*) &option_value, sizeof(option_value)) == -1) - perror("setsockopt"); + DEBUG_WARN("setsockopt"); #ifndef _WIN32 fcntl(sockfd, F_SETFL, O_NONBLOCK); @@ -142,7 +142,7 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a _tprintf(L"bind() failed with error: %u\n", WSAGetLastError()); WSACleanup(); #else - perror("bind"); + DEBUG_WARN("bind"); close(sockfd); #endif continue; @@ -152,7 +152,7 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a if (status != 0) { - perror("listen"); + DEBUG_WARN("listen"); close(sockfd); continue; } @@ -186,7 +186,7 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char* if (sockfd == -1) { - perror("socket"); + DEBUG_WARN("socket"); return FALSE; } @@ -200,7 +200,7 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char* if (status != 0) { - perror("bind"); + DEBUG_WARN("bind"); close(sockfd); return FALSE; } @@ -209,7 +209,7 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char* if (status != 0) { - perror("listen"); + DEBUG_WARN("listen"); close(sockfd); return FALSE; } @@ -306,7 +306,7 @@ static BOOL freerdp_listener_check_fds(freerdp_listener* instance) if (errno == EAGAIN || errno == EWOULDBLOCK) continue; #endif - perror("accept"); + DEBUG_WARN("accept"); if (client) free(client); return FALSE; diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index 5abeaeb19..8d247c637 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -460,7 +460,7 @@ int credssp_server_authenticate(rdpCredssp* credssp) if (!hSSPI) { - _tprintf(_T("Failed to load SSPI module: %s\n"), credssp->SspiModule); + DEBUG_WARN("Failed to load SSPI module: %s\n", credssp->SspiModule); return 0; } @@ -1397,7 +1397,7 @@ rdpCredssp* credssp_new(freerdp* instance, rdpTransport* transport, rdpSettings* if (status == ERROR_SUCCESS) { - _tprintf(_T("Using SSPI Module: %s\n"), credssp->SspiModule); + DEBUG_WARN("Using SSPI Module: %s\n", credssp->SspiModule); RegCloseKey(hKey); } } diff --git a/libfreerdp/core/tcp.c b/libfreerdp/core/tcp.c index a8484a38d..b82d3810a 100644 --- a/libfreerdp/core/tcp.c +++ b/libfreerdp/core/tcp.c @@ -667,7 +667,7 @@ BOOL tcp_set_keep_alive_mode(rdpTcp* tcp) if (setsockopt(tcp->sockfd, SOL_SOCKET, SO_KEEPALIVE, (void*) &option_value, option_len) < 0) { - perror("setsockopt() SOL_SOCKET, SO_KEEPALIVE:"); + DEBUG_WARN("setsockopt() SOL_SOCKET, SO_KEEPALIVE:"); return FALSE; } @@ -677,7 +677,7 @@ BOOL tcp_set_keep_alive_mode(rdpTcp* tcp) if (setsockopt(tcp->sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (void*) &option_value, option_len) < 0) { - perror("setsockopt() IPPROTO_TCP, TCP_KEEPIDLE:"); + DEBUG_WARN("setsockopt() IPPROTO_TCP, TCP_KEEPIDLE:"); return FALSE; } #endif @@ -688,7 +688,7 @@ BOOL tcp_set_keep_alive_mode(rdpTcp* tcp) if (setsockopt(tcp->sockfd, SOL_TCP, TCP_KEEPCNT, (void *) &option_value, option_len) < 0) { - perror("setsockopt() SOL_TCP, TCP_KEEPCNT:"); + DEBUG_WARN("setsockopt() SOL_TCP, TCP_KEEPCNT:"); return FALSE; } #endif @@ -699,7 +699,7 @@ BOOL tcp_set_keep_alive_mode(rdpTcp* tcp) if (setsockopt(tcp->sockfd, SOL_TCP, TCP_KEEPINTVL, (void *) &option_value, option_len) < 0) { - perror("setsockopt() SOL_TCP, TCP_KEEPINTVL:"); + DEBUG_WARN("setsockopt() SOL_TCP, TCP_KEEPINTVL:"); return FALSE; } #endif @@ -710,7 +710,7 @@ BOOL tcp_set_keep_alive_mode(rdpTcp* tcp) option_len = sizeof(option_value); if (setsockopt(tcp->sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *) &option_value, option_len) < 0) { - perror("setsockopt() SOL_SOCKET, SO_NOSIGPIPE:"); + DEBUG_WARN("setsockopt() SOL_SOCKET, SO_NOSIGPIPE:"); } #endif return TRUE; diff --git a/libfreerdp/utils/pcap.c b/libfreerdp/utils/pcap.c index 5e174a847..f746e933a 100644 --- a/libfreerdp/utils/pcap.c +++ b/libfreerdp/utils/pcap.c @@ -162,7 +162,7 @@ rdpPcap* pcap_open(char* name, BOOL write) if (pcap_fp == NULL) { - perror("opening pcap dump"); + DEBUG_WARN("opening pcap dump"); return NULL; } diff --git a/libfreerdp/utils/tcp.c b/libfreerdp/utils/tcp.c index d96136832..1e9aba90a 100644 --- a/libfreerdp/utils/tcp.c +++ b/libfreerdp/utils/tcp.c @@ -156,7 +156,7 @@ int freerdp_tcp_read(int sockfd, BYTE* data, int length) if (errno == EAGAIN || errno == EWOULDBLOCK) return 0; - perror("recv"); + DEBUG_WARN("recv"); #endif return -1; } @@ -179,12 +179,12 @@ int freerdp_tcp_write(int sockfd, BYTE* data, int length) if (wsa_error == WSAEWOULDBLOCK) status = 0; else - perror("send"); + DEBUG_WARN("send"); #else if (errno == EAGAIN || errno == EWOULDBLOCK) status = 0; else - perror("send"); + DEBUG_WARN("send"); #endif } diff --git a/libfreerdp/utils/uds.c b/libfreerdp/utils/uds.c index d05f6ff32..9f88f6bb7 100644 --- a/libfreerdp/utils/uds.c +++ b/libfreerdp/utils/uds.c @@ -54,7 +54,7 @@ int freerdp_uds_connect(const char* path) sockfd = socket(AF_UNIX, SOCK_STREAM, 0); if (sockfd == -1) { - perror("socket"); + DEBUG_WARN("socket"); return -1; } @@ -63,7 +63,7 @@ int freerdp_uds_connect(const char* path) status = connect(sockfd, (struct sockaddr *) &addr, sizeof(addr)); if (status < 0) { - perror("connect"); + DEBUG_WARN("connect"); close(sockfd); return -1; }