Use send/sendmsg and don't ignore SIGPIPE
This commit is contained in:
1 parent
cd2e15677a
commit
1fa3381e4b
3 files changed
+7
-5
No files matched your search
@@ -300,7 +300,7 @@ struct Connection {
|
||||
bool writeBytes() {
|
||||
for (;;) {
|
||||
assert(!request.empty());
|
||||
int w = write(fd, request.data(), request.size());
|
||||
int w = send(fd, request.data(), request.size(), MSG_NOSIGNAL);
|
||||
if (w == -1) {
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
@@ -610,7 +610,6 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
signal(SIGTERM, signal_handler);
|
||||
signal(SIGINT, signal_handler);
|
||||
|
||||
|
||||
Reference in new issue
Block a user