Skip to content

Commit

Permalink
collectors: Use closesocket() to close sockets.
Browse files Browse the repository at this point in the history
We should use closesocket() while closing sockets so that
closing sockets work fine on both POSIX and Windows.
(In POSIX, we #define closesocket close)

Without this change, sflow unit tests would cause ovs-vswitchd
to crash in Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
shettyg committed Jul 27, 2015
1 parent a454754 commit 6767b5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ofproto/collectors.c
Expand Up @@ -95,7 +95,7 @@ collectors_destroy(struct collectors *c)
size_t i;

for (i = 0; i < c->n_fds; i++) {
close(c->fds[i]);
closesocket(c->fds[i]);
}
free(c->fds);
free(c);
Expand Down

0 comments on commit 6767b5e

Please sign in to comment.