From: Adam Sutton Date: Mon, 3 Sep 2012 12:19:18 +0000 (+0100) Subject: Remove use of pipe2() and use pipe() + ioctl() calls instead. Fixes #1195. X-Git-Tag: 3.3~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77398b8726bb8b56f8004876fc00439133b08cc2;p=thirdparty%2Ftvheadend.git Remove use of pipe2() and use pipe() + ioctl() calls instead. Fixes #1195. --- 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); }