mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-16 18:06:31 +00:00
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
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user