Ticket #679: hurd-cloexec.patch

File hurd-cloexec.patch, 0.8 KB (added by sjoerd, 3 years ago)

proposed patch

  • src/modules/module-cli.c

    commit c6bb9dd1df10c49b11ac65db138fc3f34757bb41
    Author: Clint Adams <schizo@debian.org>
    Date:   Sun Oct 25 12:35:14 2009 +0000
    
        Work around some platforms not having O_CLOEXEC
    
    diff --git a/src/modules/module-cli.c b/src/modules/module-cli.c
    index 6bd0f4f..b1adb52 100644
    a b  
    105105     * of log messages, particularly because if stdout and stderr are 
    106106     * dup'ed they share the same O_NDELAY, too. */ 
    107107 
     108#ifdef O_CLOEXEC 
    108109    if ((fd = open("/dev/tty", O_RDWR|O_CLOEXEC|O_NONBLOCK)) >= 0) { 
     110#else 
     111    if ((fd = open("/dev/tty", O_RDWR|O_NONBLOCK)) >= 0) { 
     112        pa_make_fd_cloexec(fd); 
     113#endif 
    109114        io = pa_iochannel_new(m->core->mainloop, fd, fd); 
    110115        pa_log_debug("Managed to open /dev/tty."); 
    111116    } else {