Commit 7a5d310d authored by Andrei Vagin's avatar Andrei Vagin

util: print all errors in a log

CID 154076 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)
1. check_return: Calling setsockopt(sk, 6, 1, &val, 4U) without checking return value. This library function may fail and return an error code.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 5f94389c
......@@ -1143,13 +1143,15 @@ const char *ns_to_string(unsigned int ns)
void tcp_cork(int sk, bool on)
{
int val = on ? 1 : 0;
setsockopt(sk, SOL_TCP, TCP_CORK, &val, sizeof(val));
if (setsockopt(sk, SOL_TCP, TCP_CORK, &val, sizeof(val)))
pr_perror("Unable to restore TCP_CORK (%d)", val);
}
void tcp_nodelay(int sk, bool on)
{
int val = on ? 1 : 0;
setsockopt(sk, SOL_TCP, TCP_NODELAY, &val, sizeof(val));
if (setsockopt(sk, SOL_TCP, TCP_NODELAY, &val, sizeof(val)))
pr_perror("Unable to restore TCP_NODELAY (%d)", val);
}
static inline void pr_xsym(unsigned char *data, size_t len, int pos)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment