Skip to content

Commit

Permalink
fix: compile on guacamole
Browse files Browse the repository at this point in the history
  • Loading branch information
ak0327 committed Mar 8, 2024
1 parent 8bee8ab commit c32fc41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions srcs/Server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ ServerResult set_signal() {
// const std::string error_msg = CREATE_ERROR_INFO_ERRNO(errno);
// return ServerResult::err(error_msg);
// }
// if (signal(SIGPIPE, detect_received_signal) == SIG_ERR) {
// const std::string error_msg = CREATE_ERROR_INFO_ERRNO(errno);
// return ServerResult::err(error_msg);
// }
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
const std::string error_msg = CREATE_ERROR_INFO_ERRNO(errno);
return ServerResult::err(error_msg);
}
return ServerResult::ok(OK);
}

Expand Down
2 changes: 1 addition & 1 deletion srcs/Socket/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ ssize_t Socket::recv_to_buf(int fd, std::vector<unsigned char> *buf) {

ssize_t Socket::send(int fd, void *buf, std::size_t bufsize) {
errno = 0;
ssize_t send_size = ::send(fd, buf, bufsize, MSG_NOSIGNAL); // disable SIGPIPE
ssize_t send_size = ::send(fd, buf, bufsize, FLAG_NONE);
int tmp_errno = errno;
if (send_size == SEND_CONTINUE) {
const std::string error_msg = CREATE_ERROR_INFO_ERRNO(tmp_errno);
Expand Down

0 comments on commit c32fc41

Please sign in to comment.