Skip to content

Commit

Permalink
Merge pull request #121 from lidaobing/#119
Browse files Browse the repository at this point in the history
  • Loading branch information
lidaobing committed Jan 30, 2018
2 parents f0ceeba + f8081a6 commit cb2d598
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 0.7.5 (2018-XX-XX)

* [#114] fix icon size.
* [#119] check the return code of `setsockopt`.

# 0.7.4 (2018-01-24)

Expand Down
8 changes: 6 additions & 2 deletions src/iptux/support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ void socket_enable_broadcast(int sock) {

optval = 1;
len = sizeof(optval);
setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &optval, len);
if(setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &optval, len) != 0) {
LOG_WARN("setsockopt for SO_BROADCAST failed: %s", strerror(errno));
}
}

/**
Expand All @@ -317,7 +319,9 @@ void socket_enable_reuse(int sock) {

optval = 1;
len = sizeof(optval);
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, len);
if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, len) != 0) {
LOG_WARN("setsockopt for SO_REUSEADDR failed: %s", strerror(errno));
}
}

/**
Expand Down

0 comments on commit cb2d598

Please sign in to comment.