diff options
Diffstat (limited to 'res/res_pktccops.c')
-rw-r--r-- | res/res_pktccops.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/res/res_pktccops.c b/res/res_pktccops.c index e8d266cda..156c49dc7 100644 --- a/res/res_pktccops.c +++ b/res/res_pktccops.c @@ -648,7 +648,7 @@ static struct cops_gate *cops_gate_cmd(int cmd, struct cops_cmts *cmts, static int cops_connect(char *host, char *port) { - int s, sfd = -1, flags; + int s, sfd = -1; struct addrinfo hints; struct addrinfo *rp; struct addrinfo *result; @@ -674,8 +674,7 @@ static int cops_connect(char *host, char *port) if (sfd == -1) { ast_log(LOG_WARNING, "Failed socket\n"); } - flags = fcntl(sfd, F_GETFL); - fcntl(sfd, F_SETFL, flags | O_NONBLOCK); + ast_fd_set_flags(sfd, O_NONBLOCK); #ifdef HAVE_SO_NOSIGPIPE setsockopt(sfd, SOL_SOCKET, SO_NOSIGPIPE, &trueval, sizeof(trueval)); #endif |