[Asterisk-code-review] res_musiconhold: Use ast_pipe_nonblock() wrapper (...asterisk[13])

Sean Bright asteriskteam at digium.com
Mon Jul 29 10:03:44 CDT 2019


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11641


Change subject: res_musiconhold: Use ast_pipe_nonblock() wrapper
......................................................................

res_musiconhold: Use ast_pipe_nonblock() wrapper

Change-Id: Ib0a4b41e5ececbe633079e2d8c2b66c031d2d1f2
---
M res/res_musiconhold.c
1 file changed, 1 insertion(+), 5 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/41/11641/1

diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 85eb576..4b2e1fb 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -945,16 +945,12 @@
 	if (!(moh = ast_calloc(1, sizeof(*moh))))
 		return NULL;
 
-	if (pipe(moh->pipe)) {
+	if (ast_pipe_nonblock(moh->pipe)) {
 		ast_log(LOG_WARNING, "Failed to create pipe: %s\n", strerror(errno));
 		ast_free(moh);
 		return NULL;
 	}
 
-	/* Make entirely non-blocking */
-	ast_fd_set_flags(moh->pipe[0], O_NONBLOCK);
-	ast_fd_set_flags(moh->pipe[1], O_NONBLOCK);
-
 	moh->f.frametype = AST_FRAME_VOICE;
 	moh->f.subclass.format = cl->format;
 	moh->f.offset = AST_FRIENDLY_OFFSET;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11641
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ib0a4b41e5ececbe633079e2d8c2b66c031d2d1f2
Gerrit-Change-Number: 11641
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190729/6892c939/attachment.html>


More information about the asterisk-code-review mailing list