Commit bc2ac71c authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

sk-unix: don't add a socket in a second time

A socket can be added in a list two times, if two other sockets
are connected to it.

This patch fixes a problem:
    Error (sk-unix.c:395): BUG at sk-unix.c:395
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 0c72ab18
...@@ -163,7 +163,7 @@ static int dump_one_unix_fd(int lfd, u32 id, const struct fd_parms *p) ...@@ -163,7 +163,7 @@ static int dump_one_unix_fd(int lfd, u32 id, const struct fd_parms *p)
* It can be external socket, so we defer dumping * It can be external socket, so we defer dumping
* until all sockets the program owns are processed. * until all sockets the program owns are processed.
*/ */
if (!peer->sd.already_dumped) { if (!peer->sd.already_dumped && !list_empty(&peer->list)) {
show_one_unix("Add a peer", peer); show_one_unix("Add a peer", peer);
list_add_tail(&peer->list, &unix_sockets); list_add_tail(&peer->list, &unix_sockets);
} }
......
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