Skip to content

Commit

Permalink
Try to amend #31
Browse files Browse the repository at this point in the history
  • Loading branch information
npyl committed Jul 11, 2018
1 parent 124b3df commit 992bb0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/net_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,11 @@ int interface_up(struct text_object *obj) {

if (dev == nullptr) { return 0; }

#if defined(__APPLE__) && defined(__MACH__)
if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
#else
if ((fd = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) {
#endif
CRIT_ERR(nullptr, nullptr, "could not create sockfd");
return 0;
}
Expand Down

0 comments on commit 992bb0f

Please sign in to comment.