conmon: Close client on zero read from attach client
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
This commit is contained in:
parent
0b6f68479b
commit
6e53568d15
1 changed files with 7 additions and 1 deletions
|
@ -1002,7 +1002,13 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
num_read = read(masterfd, buf, BUF_SIZE);
|
num_read = read(masterfd, buf, BUF_SIZE);
|
||||||
if (num_read <= 0)
|
if (num_read == 0) {
|
||||||
|
ninfo("Remote socket closed");
|
||||||
|
close(conn_sock);
|
||||||
|
conn_sock = -1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (num_read < 0)
|
||||||
goto out;
|
goto out;
|
||||||
ninfo("got data on connection: %d", num_read);
|
ninfo("got data on connection: %d", num_read);
|
||||||
if (terminal) {
|
if (terminal) {
|
||||||
|
|
Loading…
Reference in a new issue