Skip to content

Commit

Permalink
Merge pull request #1975 from lemenkov/rtpengine_rearrange_macro_def
Browse files Browse the repository at this point in the history
rtpengine: Move RTPE_IO_ERROR_CLOSE definition up
  • Loading branch information
razvancrainea committed Feb 18, 2020
2 parents 675a10e + 519c58d commit 3397730
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions modules/rtpengine/rtpengine.c
Expand Up @@ -134,6 +134,15 @@
lock_stop_read(rtpe_lock); \
} while (0)

#define RTPE_IO_ERROR_CLOSE(_fd) \
do { \
if (errno == EPIPE || errno == EBADF) { \
LM_INFO("Closing rtpengine socket %d\n", (_fd)); \
close((_fd)); \
(_fd) = -1; \
} \
} while (0)

enum rtpe_operation {
OP_OFFER = 1,
OP_ANSWER,
Expand Down Expand Up @@ -2198,15 +2207,6 @@ rtpe_test(struct rtpe_node *node, int isdisabled, int force)
return 1;
}

#define RTPE_IO_ERROR_CLOSE(_fd) \
do { \
if (errno == EPIPE || errno == EBADF) { \
LM_INFO("Closing rtpengine socket %d\n", (_fd)); \
close((_fd)); \
(_fd) = -1; \
} \
} while (0)

static char *
send_rtpe_command(struct rtpe_node *node, bencode_item_t *dict, int *outlen)
{
Expand Down Expand Up @@ -2339,7 +2339,6 @@ send_rtpe_command(struct rtpe_node *node, bencode_item_t *dict, int *outlen)
node->rn_recheck_ticks = get_ticks() + rtpengine_disable_tout;

return NULL;
#undef RTPE_IO_ERROR_CLOSE
}

/*
Expand Down

0 comments on commit 3397730

Please sign in to comment.