diff options
author | Sean Bright <sean.bright@gmail.com> | 2017-12-07 10:52:39 -0500 |
---|---|---|
committer | Sean Bright <sean.bright@gmail.com> | 2017-12-08 13:28:04 -0600 |
commit | 2ffe52a116ad05d060cbedda93c48cf5a4415ca3 (patch) | |
tree | 9f8d99288f532ad213b8681e7616c26e8535df24 /res/res_timing_pthread.c | |
parent | b0b28446c1e5f76c54b823bc3f4e2a5423c9c79b (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 'res/res_timing_pthread.c')
-rw-r--r-- | res/res_timing_pthread.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c index 09952f929..f52079643 100644 --- a/res/res_timing_pthread.c +++ b/res/res_timing_pthread.c @@ -130,9 +130,7 @@ static void *pthread_timer_open(void) } for (i = 0; i < ARRAY_LEN(timer->pipe); ++i) { - int flags = fcntl(timer->pipe[i], F_GETFL); - flags |= O_NONBLOCK; - fcntl(timer->pipe[i], F_SETFL, flags); + ast_fd_set_flags(timer->pipe[i], O_NONBLOCK); } ao2_lock(pthread_timers); |