summaryrefslogtreecommitdiff
path: root/main/iostream.c
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-12-07 10:52:39 -0500
committerSean Bright <sean.bright@gmail.com>2017-12-08 13:27:42 -0600
commitf9c6f692053ac865d46cbf8843ab810dc66cba67 (patch)
tree60bfe167eee2d096abe839803fdd4e4691f6c562 /main/iostream.c
parent52de5a05f0f6bf534c0642a4f43daa562b5b9004 (diff)
utils: Add convenience function for setting fd flags
There are many places in the code base where we ignore the return value of fcntl() when getting/setting file descriptior flags. This patch introduces a convenience function that allows setting or clearing file descriptor flags and will also log an error on failure for later analysis. Change-Id: I8b81901e1b1bd537ca632567cdb408931c6eded7
Diffstat (limited to 'main/iostream.c')
-rw-r--r--main/iostream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/iostream.c b/main/iostream.c
index d91863319..aaa74fae1 100644
--- a/main/iostream.c
+++ b/main/iostream.c
@@ -77,7 +77,7 @@ int ast_iostream_get_fd(struct ast_iostream *stream)
void ast_iostream_nonblock(struct ast_iostream *stream)
{
- fcntl(stream->fd, F_SETFL, fcntl(stream->fd, F_GETFL) | O_NONBLOCK);
+ ast_fd_set_flags(stream->fd, O_NONBLOCK);
}
SSL *ast_iostream_get_ssl(struct ast_iostream *stream)