mirror of
https://github.com/topjohnwu/ndk-busybox.git
synced 2024-11-25 12:49:54 +00:00
Shutdown sending on the socket when stdin closes.
This commit is contained in:
parent
6f6aa9b428
commit
95fa0ea3d4
2
nc.c
2
nc.c
@ -111,6 +111,8 @@ int nc_main(int argc, char **argv)
|
|||||||
exit(0);
|
exit(0);
|
||||||
ofd = fileno(stdout);
|
ofd = fileno(stdout);
|
||||||
} else {
|
} else {
|
||||||
|
if (nread == 0)
|
||||||
|
shutdown(sfd, 1);
|
||||||
ofd = sfd;
|
ofd = sfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +111,8 @@ int nc_main(int argc, char **argv)
|
|||||||
exit(0);
|
exit(0);
|
||||||
ofd = fileno(stdout);
|
ofd = fileno(stdout);
|
||||||
} else {
|
} else {
|
||||||
|
if (nread == 0)
|
||||||
|
shutdown(sfd, 1);
|
||||||
ofd = sfd;
|
ofd = sfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user