Commit 7148e16b authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Andrei Vagin

sk-tcp: Print libsoccr_save() error message

Improve dump_tcp_conn_state() *debugibility*.
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent dc4d61f8
...@@ -113,8 +113,10 @@ static int dump_tcp_conn_state(struct inet_sk_desc *sk) ...@@ -113,8 +113,10 @@ static int dump_tcp_conn_state(struct inet_sk_desc *sk)
struct libsoccr_sk_data data; struct libsoccr_sk_data data;
ret = libsoccr_save(socr, &data, sizeof(data)); ret = libsoccr_save(socr, &data, sizeof(data));
if (ret < 0) if (ret < 0) {
pr_err("libsoccr_save() failed with %d\n", ret);
goto err_r; goto err_r;
}
if (ret != sizeof(data)) { if (ret != sizeof(data)) {
pr_err("This libsocr is not supported (%d vs %d)\n", pr_err("This libsocr is not supported (%d vs %d)\n",
ret, (int)sizeof(data)); ret, (int)sizeof(data));
......
...@@ -374,10 +374,10 @@ int libsoccr_save(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigne ...@@ -374,10 +374,10 @@ int libsoccr_save(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigne
sk->flags |= SK_FLAG_FREE_SQ | SK_FLAG_FREE_RQ; sk->flags |= SK_FLAG_FREE_SQ | SK_FLAG_FREE_RQ;
if (get_queue(sk->fd, TCP_RECV_QUEUE, &data->inq_seq, data->inq_len, &sk->recv_queue)) if (get_queue(sk->fd, TCP_RECV_QUEUE, &data->inq_seq, data->inq_len, &sk->recv_queue))
return -4; return -5;
if (get_queue(sk->fd, TCP_SEND_QUEUE, &data->outq_seq, data->outq_len, &sk->send_queue)) if (get_queue(sk->fd, TCP_SEND_QUEUE, &data->outq_seq, data->outq_len, &sk->send_queue))
return -5; return -6;
return sizeof(struct libsoccr_sk_data); return sizeof(struct libsoccr_sk_data);
} }
......
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