From 77398b8726bb8b56f8004876fc00439133b08cc2 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Mon, 3 Sep 2012 13:19:18 +0100 Subject: [PATCH] Remove use of pipe2() and use pipe() + ioctl() calls instead. Fixes #1195. --- src/dvb/dvb_adapter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dvb/dvb_adapter.c b/src/dvb/dvb_adapter.c index baad51c65..f4450a58b 100644 --- a/src/dvb/dvb_adapter.c +++ b/src/dvb/dvb_adapter.c @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#define _GNU_SOURCE #include #include @@ -460,7 +459,10 @@ dvb_adapter_start ( th_dvb_adapter_t *tda ) /* Start DVR thread */ if (tda->tda_dvr_pipe[0] == -1) { - assert(pipe2(tda->tda_dvr_pipe, O_NONBLOCK | O_CLOEXEC) != -1); + assert(pipe(tda->tda_dvr_pipe) != -1); + fcntl(tda->tda_dvr_pipe[0], F_SETFD, fcntl(tda->tda_dvr_pipe[0], F_GETFD) | FD_CLOEXEC); + fcntl(tda->tda_dvr_pipe[0], F_SETFL, fcntl(tda->tda_dvr_pipe[0], F_GETFL) | O_NONBLOCK); + fcntl(tda->tda_dvr_pipe[1], F_SETFD, fcntl(tda->tda_dvr_pipe[1], F_GETFD) | FD_CLOEXEC); pthread_create(&tda->tda_dvr_thread, NULL, dvb_adapter_input_dvr, tda); tvhlog(LOG_DEBUG, "dvb", "%s started dvr thread", tda->tda_rootpath); } -- 2.47.3