mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-15 22:38:08 +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:
@@ -1955,9 +1955,7 @@ static void *httpd_helper_thread(void *data)
|
||||
}
|
||||
|
||||
/* make sure socket is non-blocking */
|
||||
flags = fcntl(ser->fd, F_GETFL);
|
||||
flags |= O_NONBLOCK;
|
||||
fcntl(ser->fd, F_SETFL, flags);
|
||||
ast_fd_set_flags(ser->fd, O_NONBLOCK);
|
||||
|
||||
/* Setup HTTP worker private data to keep track of request body reading. */
|
||||
ao2_cleanup(ser->private_data);
|
||||
|
||||
Reference in New Issue
Block a user