Project

General

Profile

Bug #1195 ยป t.patch

Adam Sutton, 2012-09-03 12:45

View differences:

src/dvb/dvb_adapter.c
16 16
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 17
 */
18 18

  
19
#define _GNU_SOURCE
20 19
#include <pthread.h>
21 20
#include <assert.h>
22 21

  
......
460 459

  
461 460
  /* Start DVR thread */
462 461
  if (tda->tda_dvr_pipe[0] == -1) {
463
    assert(pipe2(tda->tda_dvr_pipe, O_NONBLOCK | O_CLOEXEC) != -1);
462
    assert(pipe(tda->tda_dvr_pipe) != -1);
463
    fcntl(tda->tda_dvr_pipe[0], F_SETFD, fcntl(tda->tda_dvr_pipe[0], F_GETFD) | FD_CLOEXEC);
464
    fcntl(tda->tda_dvr_pipe[0], F_SETFL, fcntl(tda->tda_dvr_pipe[0], F_GETFL) | O_NONBLOCK);
465
    fcntl(tda->tda_dvr_pipe[1], F_SETFD, fcntl(tda->tda_dvr_pipe[1], F_GETFD) | FD_CLOEXEC);
464 466
    pthread_create(&tda->tda_dvr_thread, NULL, dvb_adapter_input_dvr, tda);
465 467
    tvhlog(LOG_DEBUG, "dvb", "%s started dvr thread", tda->tda_rootpath);
466 468
  }
    (1-1/1)