Ticket #817: hurd.patch

File hurd.patch, 4.6 KB (added by pino, 6 months ago)

Hurd fixes for PulseAudio 1.1

  • src/pulse/context.c

    a b  
    660660        goto fail; 
    661661    } 
    662662 
    663     if ((sa.sa_flags & SA_NOCLDWAIT) || sa.sa_handler == SIG_IGN) { 
     663    if ( 
     664#ifdef SA_NOCLDWAIT 
     665        (sa.sa_flags & SA_NOCLDWAIT) || 
     666#endif 
     667        sa.sa_handler == SIG_IGN) { 
    664668        pa_log_debug("Process disabled waitpid(), cannot autospawn."); 
    665669        pa_context_fail(c, PA_ERR_CONNECTIONREFUSED); 
    666670        goto fail; 
  • src/pulsecore/mutex-posix.c

    a b  
    5050        pa_assert_se(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) == 0); 
    5151 
    5252#ifdef HAVE_PTHREAD_PRIO_INHERIT 
    53     if (inherit_priority) 
    54         pa_assert_se(pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT) == 0); 
     53    if (inherit_priority) { 
     54        r = pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); 
     55        pa_assert_se(r == 0 || r == ENOTSUP); 
     56    } 
    5557#endif 
    5658 
    5759    m = pa_xnew(pa_mutex, 1); 
  • src/modules/rtp/rtp.c

    a b  
    278278    } 
    279279 
    280280    for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm)) 
    281         if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SO_TIMESTAMP) { 
     281        if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_TIMESTAMP) { 
    282282            memcpy(tstamp, CMSG_DATA(cm), sizeof(struct timeval)); 
    283283            found_tstamp = TRUE; 
    284284            break; 
  • src/modules/rtp/module-rtp-recv.c

    a b  
    428428 
    429429    pa_make_udp_socket_low_delay(fd); 
    430430 
     431#ifdef SO_TIMESTAMP 
    431432    one = 1; 
    432433    if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)) < 0) { 
    433434        pa_log("SO_TIMESTAMP failed: %s", pa_cstrerror(errno)); 
    434435        goto fail; 
    435436    } 
     437#else 
     438    goto fail; 
     439#endif 
    436440 
    437441    one = 1; 
    438442    if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) { 
  • src/modules/module-pipe-source.c

    a b  
    286286 
    287287    pa_source_set_asyncmsgq(u->source, u->thread_mq.inq); 
    288288    pa_source_set_rtpoll(u->source, u->rtpoll); 
    289     pa_source_set_fixed_latency(u->source, pa_bytes_to_usec(PIPE_BUF, &u->source->sample_spec)); 
     289    pa_source_set_fixed_latency(u->source, pa_bytes_to_usec(pa_pipe_buf(u->fd), &u->source->sample_spec)); 
    290290 
    291291    u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1); 
    292292    pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL); 
  • src/utils/pacmd.c

    a b  
    4747    int fd = -1; 
    4848    int ret = 1, i; 
    4949    struct sockaddr_un sa; 
    50     char ibuf[PIPE_BUF], obuf[PIPE_BUF]; 
    51     size_t ibuf_index, ibuf_length, obuf_index, obuf_length; 
     50    char *ibuf = NULL; 
     51    char *obuf = NULL; 
     52    size_t ibuf_size, ibuf_index, ibuf_length, obuf_size, obuf_index, obuf_length; 
    5253    char *cli; 
    5354    pa_bool_t ibuf_eof, obuf_eof, ibuf_closed, obuf_closed; 
    5455    struct pollfd pollfd[3]; 
     
    102103        goto fail; 
    103104    } 
    104105 
     106    i = pa_pipe_buf(fd); 
     107    ibuf_size = PA_MIN(i, pa_pipe_buf(STDIN_FILENO)); 
     108    ibuf = pa_xmalloc(ibuf_size); 
     109    obuf_size = PA_MIN(i, pa_pipe_buf(STDOUT_FILENO)); 
     110    obuf = pa_xmalloc(obuf_size); 
    105111    ibuf_index = ibuf_length = obuf_index = obuf_length = 0; 
    106112    ibuf_eof = obuf_eof = ibuf_closed = obuf_closed = FALSE; 
    107113 
     
    109115        for (i = 1; i < argc; i++) { 
    110116            size_t k; 
    111117 
    112             k = PA_MIN(sizeof(ibuf) - ibuf_length, strlen(argv[i])); 
     118            k = PA_MIN(ibuf_size - ibuf_length, strlen(argv[i])); 
    113119            memcpy(ibuf + ibuf_length, argv[i], k); 
    114120            ibuf_length += k; 
    115121 
    116             if (ibuf_length < sizeof(ibuf)) { 
     122            if (ibuf_length < ibuf_size) { 
    117123                ibuf[ibuf_length] = i < argc-1 ? ' ' : '\n'; 
    118124                ibuf_length++; 
    119125            } 
     
    182188                ssize_t r; 
    183189                pa_assert(ibuf_length <= 0); 
    184190 
    185                 if ((r = pa_read(STDIN_FILENO, ibuf, sizeof(ibuf), &stdin_type)) <= 0) { 
     191                if ((r = pa_read(STDIN_FILENO, ibuf, ibuf_size, &stdin_type)) <= 0) { 
    186192                    if (r < 0) { 
    187193                        pa_log(_("read(): %s"), strerror(errno)); 
    188194                        goto fail; 
     
    202208                ssize_t r; 
    203209                pa_assert(obuf_length <= 0); 
    204210 
    205                 if ((r = pa_read(fd, obuf, sizeof(obuf), &fd_type)) <= 0) { 
     211                if ((r = pa_read(fd, obuf, obuf_size, &fd_type)) <= 0) { 
    206212                    if (r < 0) { 
    207213                        pa_log(_("read(): %s"), strerror(errno)); 
    208214                        goto fail; 
     
    260266    if (fd >= 0) 
    261267        pa_close(fd); 
    262268 
     269    pa_xfree(obuf); 
     270    pa_xfree(ibuf); 
     271 
    263272    return ret; 
    264273}