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

Friendly Automation asteriskteam at digium.com
Wed Jul 31 07:22:42 CDT 2019


Friendly Automation has submitted this change and it was merged. ( 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(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



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-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190731/b2ccec8d/attachment-0001.html>


More information about the asterisk-code-review mailing list