]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_musiconhold: Use ast_pipe_nonblock() wrapper
authorSean Bright <sean.bright@gmail.com>
Mon, 29 Jul 2019 15:04:00 +0000 (11:04 -0400)
committerSean Bright <sean.bright@gmail.com>
Mon, 29 Jul 2019 15:04:00 +0000 (11:04 -0400)
Change-Id: Ib0a4b41e5ececbe633079e2d8c2b66c031d2d1f2

res/res_musiconhold.c

index 85eb576f9b1e66fcd7a4a6c77830a5f22df93981..4b2e1fb9b7300e994e885611d4941c1f575c625d 100644 (file)
@@ -945,16 +945,12 @@ static struct mohdata *mohalloc(struct mohclass *cl)
        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;