diff options
author | Laxmikant Rashinkar <LK.Rashinkar@gmail.com> | 2014-07-20 13:14:09 -0700 |
---|---|---|
committer | Laxmikant Rashinkar <LK.Rashinkar@gmail.com> | 2014-07-20 13:14:09 -0700 |
commit | a990287c4627ff6b0d3b6a42b06d1f4ce242d918 (patch) | |
tree | 865e232ed7d8fd0de40a5f88742dcd5ef7f3481a /common/os_calls.c | |
parent | 023c0b5bc1591fad9094d2e440b6315a8ff908d8 (diff) | |
download | xrdp-proprietary-a990287c4627ff6b0d3b6a42b06d1f4ce242d918.tar.gz xrdp-proprietary-a990287c4627ff6b0d3b6a42b06d1f4ce242d918.zip |
coverity: fixed unchecked return value from library
Diffstat (limited to 'common/os_calls.c')
-rw-r--r-- | common/os_calls.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/common/os_calls.c b/common/os_calls.c index 1d3a71b1..68a6a5b0 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -471,8 +471,11 @@ g_tcp_socket(void) { option_value = 0; option_len = sizeof(option_value); - setsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&option_value, - option_len); + if (setsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&option_value, + option_len) < 0) + { + log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed\n"); + } } } #endif @@ -484,8 +487,11 @@ g_tcp_socket(void) { option_value = 1; option_len = sizeof(option_value); - setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *)&option_value, - option_len); + if (setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *)&option_value, + option_len) < 0) + { + log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed\n"); + } } } @@ -498,8 +504,11 @@ g_tcp_socket(void) { option_value = 1024 * 32; option_len = sizeof(option_value); - setsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *)&option_value, - option_len); + if (setsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *)&option_value, + option_len) < 0) + { + log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed\n"); + } } } @@ -785,7 +794,10 @@ g_tcp_set_non_blocking(int sck) #else i = fcntl(sck, F_GETFL); i = i | O_NONBLOCK; - fcntl(sck, F_SETFL, i); + if (fcntl(sck, F_SETFL, i) < 0) + { + log_message(LOG_LEVEL_ERROR, "g_tcp_set_non_blocking: fcntl() failed\n"); + } #endif return 0; } @@ -1421,7 +1433,12 @@ g_set_wait_obj(tbus obj) return 1; } - sendto(s, "sig", 4, 0, (struct sockaddr *)&sa, sa_size); + if (sendto(s, "sig", 4, 0, (struct sockaddr *)&sa, sa_size) < 0) + { + close(s); + return 1; + } + close(s); return 0; #endif @@ -1934,8 +1951,7 @@ g_mkdir(const char *dirname) #if defined(_WIN32) return 0; #else - mkdir(dirname, S_IRWXU); - return 0; + return mkdir(dirname, S_IRWXU); #endif } |