stutterfuzz: Fix crash when shutdown() returns ENOTCONN

This commit is contained in:
Ian Gulliver
2016-03-04 19:17:15 -08:00
parent 746379aee5
commit 06e73e2319

View File

@@ -177,8 +177,8 @@ void send_write(struct packet *packet) {
}
if (write(iter->peer.fd, buf_at(&buf, 0), buf.length) != (ssize_t) buf.length) {
// peer_loop() will see this shutdown and call send_del
int res = shutdown(iter->peer.fd, SHUT_WR);
assert(res == 0 || (res == -1 && errno == ENOTSOCK));
// Ignore error
shutdown(iter->peer.fd, SHUT_WR);
}
}
}