diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.am | 4 | ||||
| -rw-r--r-- | src/pulsecore/authkey.c | 4 | ||||
| -rw-r--r-- | src/pulsecore/core-util.c | 45 | ||||
| -rw-r--r-- | src/pulsecore/fdsem.c | 7 | ||||
| -rw-r--r-- | src/pulsecore/ioline.c | 1 | ||||
| -rw-r--r-- | src/pulsecore/mutex-win32.c | 2 | ||||
| -rw-r--r-- | src/pulsecore/once.c | 2 | ||||
| -rw-r--r-- | src/pulsecore/pid.c | 5 | ||||
| -rw-r--r-- | src/pulsecore/rtsig.h | 3 | ||||
| -rw-r--r-- | src/pulsecore/sound-file-stream.c | 6 | ||||
| -rw-r--r-- | src/pulsecore/sound-file.c | 6 | ||||
| -rw-r--r-- | src/pulsecore/thread-win32.c | 19 | ||||
| -rw-r--r-- | src/pulsecore/winsock.h | 2 | 
13 files changed, 82 insertions, 24 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index e1d210b0..98e78745 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -78,8 +78,8 @@ endif  if OS_IS_WIN32  PA_THREAD_OBJS = \  		pulsecore/mutex-win32.c pulsecore/mutex.h \ -		pulsecore/thread-win32.c pulsecore/thread.h -#		pulsecore/semaphore-win32.c pulsecore/semaphore.h +		pulsecore/thread-win32.c pulsecore/thread.h \ +		pulsecore/semaphore-win32.c pulsecore/semaphore.h  else  PA_THREAD_OBJS = \  		pulsecore/mutex-posix.c pulsecore/mutex.h \ diff --git a/src/pulsecore/authkey.c b/src/pulsecore/authkey.c index 4d9bfd3a..d422d6a2 100644 --- a/src/pulsecore/authkey.c +++ b/src/pulsecore/authkey.c @@ -71,6 +71,10 @@ static int generate(int fd, void *ret_data, size_t length) {  #define O_BINARY 0  #endif +#ifndef O_NOCTTY +#define O_NOCTTY 0 +#endif +  /* Load an euthorization cookie from file fn and store it in data. If   * the cookie file doesn't exist, create it */  static int load(const char *fn, void *data, size_t length) { diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 3defe2bc..a644b664 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -653,13 +653,21 @@ const char *pa_sig2str(int sig) {          case SIGHUP:    return "SIGHUP";  #endif          case SIGINT:    return "SIGINT"; +#ifdef SIGQUIT          case SIGQUIT:   return "SIGQUIT"; +#endif          case SIGILL:    return "SIGULL"; +#ifdef SIGTRAP          case SIGTRAP:   return "SIGTRAP"; +#endif          case SIGABRT:   return "SIGABRT"; +#ifdef SIGBUS          case SIGBUS:    return "SIGBUS"; +#endif          case SIGFPE:    return "SIGFPE"; +#ifdef SIGKILL          case SIGKILL:   return "SIGKILL"; +#endif  #ifdef SIGUSR1          case SIGUSR1:   return "SIGUSR1";  #endif @@ -670,30 +678,58 @@ const char *pa_sig2str(int sig) {  #ifdef SIGPIPE          case SIGPIPE:   return "SIGPIPE";  #endif +#ifdef SIGALRM          case SIGALRM:   return "SIGALRM"; +#endif          case SIGTERM:   return "SIGTERM"; +#ifdef SIGSTKFLT          case SIGSTKFLT: return "SIGSTKFLT"; +#endif  #ifdef SIGCHLD          case SIGCHLD:   return "SIGCHLD";  #endif +#ifdef SIGCONT          case SIGCONT:   return "SIGCONT"; +#endif +#ifdef SIGSTOP          case SIGSTOP:   return "SIGSTOP"; +#endif +#ifdef SIGTSTP          case SIGTSTP:   return "SIGTSTP"; +#endif +#ifdef SIGTTIN          case SIGTTIN:   return "SIGTTIN"; +#endif +#ifdef SIGTTOU          case SIGTTOU:   return "SIGTTOU"; +#endif +#ifdef SIGURG          case SIGURG:    return "SIGURG"; +#endif  #ifdef SIGXCPU          case SIGXCPU:   return "SIGXCPU";  #endif  #ifdef SIGXFSZ          case SIGXFSZ:   return "SIGXFSZ";  #endif +#ifdef SIGVTALRM          case SIGVTALRM: return "SIGVTALRM"; +#endif +#ifdef SIGPROF          case SIGPROF:   return "SIGPROF"; +#endif +#ifdef SIGWINCH          case SIGWINCH:  return "SIGWINCH"; +#endif +#ifdef SIGIO          case SIGIO:     return "SIGIO"; +#endif +#ifdef SIGPWR          case SIGPWR:    return "SIGPWR"; +#endif +#ifdef SIGSYS          case SIGSYS:    return "SIGSYS"; +#endif      }  #ifdef SIGRTMIN @@ -943,7 +979,10 @@ int pa_lock_lockfile(const char *fn) {      for (;;) {          struct stat st; -        if ((fd = open(fn, O_CREAT|O_RDWR|O_NOCTTY +        if ((fd = open(fn, O_CREAT|O_RDWR +#ifdef O_NOCTTY +                       |O_NOCTTY +#endif  #ifdef O_NOFOLLOW                         |O_NOFOLLOW  #endif @@ -1431,6 +1470,7 @@ void *pa_will_need(const void *p, size_t l) {      pa_log_debug("posix_madvise() failed (or doesn't exist), trying mlock(): %s", pa_cstrerror(r)); +#ifdef HAVE_MLOCK      while (size > 0 && bs > 0) {          if (bs > size) @@ -1446,9 +1486,10 @@ void *pa_will_need(const void *p, size_t l) {          a = (const uint8_t*) a + bs;          size -= bs;      } +#endif      if (bs <= 0) -        pa_log_debug("mlock() failed too, giving up: %s", pa_cstrerror(errno)); +        pa_log_debug("mlock() failed too (or doesn't exist), giving up: %s", pa_cstrerror(errno));      else          pa_log_debug("mlock() worked fine!"); diff --git a/src/pulsecore/fdsem.c b/src/pulsecore/fdsem.c index b919ba41..927bf00c 100644 --- a/src/pulsecore/fdsem.c +++ b/src/pulsecore/fdsem.c @@ -25,7 +25,10 @@  #include <config.h>  #endif +#ifdef HAVE_SYS_SYSCALL_H  #include <sys/syscall.h> +#endif +  #include <unistd.h>  #include <errno.h> @@ -36,6 +39,10 @@  #include <pulsecore/core-util.h>  #include <pulse/xmalloc.h> +#ifndef HAVE_PIPE +#include <pulsecore/pipe.h> +#endif +  #ifdef __linux__  #if !defined(__NR_eventfd) && defined(__i386__) diff --git a/src/pulsecore/ioline.c b/src/pulsecore/ioline.c index a3627003..efb50722 100644 --- a/src/pulsecore/ioline.c +++ b/src/pulsecore/ioline.c @@ -32,6 +32,7 @@  #include <pulse/xmalloc.h> +#include <pulsecore/winsock.h>  #include <pulsecore/core-error.h>  #include <pulsecore/log.h>  #include <pulsecore/macro.h> diff --git a/src/pulsecore/mutex-win32.c b/src/pulsecore/mutex-win32.c index 1f16e24c..77d63d15 100644 --- a/src/pulsecore/mutex-win32.c +++ b/src/pulsecore/mutex-win32.c @@ -40,7 +40,7 @@ struct pa_cond {      pa_hashmap *wait_events;  }; -pa_mutex* pa_mutex_new(int recursive) { +pa_mutex* pa_mutex_new(pa_bool_t recursive, pa_bool_t inherit_priority) {      pa_mutex *m;      m = pa_xnew(pa_mutex, 1); diff --git a/src/pulsecore/once.c b/src/pulsecore/once.c index 4f6e5b62..198bd41e 100644 --- a/src/pulsecore/once.c +++ b/src/pulsecore/once.c @@ -25,8 +25,6 @@  #include <config.h>  #endif -#include <pthread.h> -  #include <pulsecore/macro.h>  #include <pulsecore/mutex.h> diff --git a/src/pulsecore/pid.c b/src/pulsecore/pid.c index 38d26814..55ff2088 100644 --- a/src/pulsecore/pid.c +++ b/src/pulsecore/pid.c @@ -88,7 +88,10 @@ static int open_pid_file(const char *fn, int mode) {      for (;;) {          struct stat st; -        if ((fd = open(fn, mode|O_NOCTTY +        if ((fd = open(fn, mode +#ifdef O_NOCTTY +                       |O_NOCTTY +#endif  #ifdef O_NOFOLLOW                         |O_NOFOLLOW  #endif diff --git a/src/pulsecore/rtsig.h b/src/pulsecore/rtsig.h index 48f5f050..7830d272 100644 --- a/src/pulsecore/rtsig.h +++ b/src/pulsecore/rtsig.h @@ -24,9 +24,6 @@    USA.  ***/ -#include <poll.h> -#include <sys/types.h> -  /* Return the next unused POSIX Realtime signals */  int pa_rtsig_get(void); diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c index 6c70c4f1..d9f11a26 100644 --- a/src/pulsecore/sound-file-stream.c +++ b/src/pulsecore/sound-file-stream.c @@ -244,7 +244,11 @@ int pa_play_file(      memset(&sfinfo, 0, sizeof(sfinfo)); -    if ((fd = open(fname, O_RDONLY|O_NOCTTY)) < 0) { +    if ((fd = open(fname, O_RDONLY +#ifdef O_NOCTTY +                   |O_NOCTTY +#endif +                   )) < 0) {          pa_log("Failed to open file %s: %s", fname, pa_cstrerror(errno));          goto fail;      } diff --git a/src/pulsecore/sound-file.c b/src/pulsecore/sound-file.c index b1c509f2..50352930 100644 --- a/src/pulsecore/sound-file.c +++ b/src/pulsecore/sound-file.c @@ -63,7 +63,11 @@ int pa_sound_file_load(      pa_memchunk_reset(chunk);      memset(&sfinfo, 0, sizeof(sfinfo)); -    if ((fd = open(fname, O_RDONLY|O_NOCTTY)) < 0) { +    if ((fd = open(fname, O_RDONLY +#ifdef O_NOCTTY +                   |O_NOCTTY +#endif +                   )) < 0) {          pa_log("Failed to open file %s: %s", fname, pa_cstrerror(errno));          goto finish;      } diff --git a/src/pulsecore/thread-win32.c b/src/pulsecore/thread-win32.c index 46d273b4..cad1420a 100644 --- a/src/pulsecore/thread-win32.c +++ b/src/pulsecore/thread-win32.c @@ -53,9 +53,8 @@ struct pa_tls_monitor {  };  static pa_tls *thread_tls; -static pa_once_t thread_tls_once = PA_ONCE_INIT; +static pa_once thread_tls_once = PA_ONCE_INIT;  static pa_tls *monitor_tls; -static pa_once_t monitor_tls_once = PA_ONCE_INIT;  static void thread_tls_once_func(void) {      thread_tls = pa_tls_new(NULL); @@ -66,7 +65,7 @@ static DWORD WINAPI internal_thread_func(LPVOID param) {      pa_thread *t = param;      assert(t); -    pa_once(&thread_tls_once, thread_tls_once_func); +    pa_run_once(&thread_tls_once, thread_tls_once_func);      pa_tls_set(thread_tls, t);      t->thread_func(t->userdata); @@ -122,7 +121,7 @@ int pa_thread_join(pa_thread *t) {  }  pa_thread* pa_thread_self(void) { -    pa_once(&thread_tls_once, thread_tls_once_func); +    pa_run_once(&thread_tls_once, thread_tls_once_func);      return pa_tls_get(thread_tls);  } @@ -130,12 +129,6 @@ void pa_thread_yield(void) {      Sleep(0);  } -static void monitor_tls_once_func(void) { -    monitor_tls = pa_tls_new(NULL); -    assert(monitor_tls); -    pa_tls_set(monitor_tls, NULL); -} -  static DWORD WINAPI monitor_thread_func(LPVOID param) {      struct pa_tls_monitor *m = param;      assert(m); @@ -191,7 +184,11 @@ void *pa_tls_set(pa_tls *t, void *userdata) {      if (t->free_func) {          struct pa_tls_monitor *m; -        pa_once(&monitor_tls_once, monitor_tls_once_func); +        PA_ONCE_BEGIN { +            monitor_tls = pa_tls_new(NULL); +            assert(monitor_tls); +            pa_tls_set(monitor_tls, NULL); +        } PA_ONCE_END;          m = pa_tls_get(monitor_tls);          if (!m) { diff --git a/src/pulsecore/winsock.h b/src/pulsecore/winsock.h index ae868b38..0352bf4d 100644 --- a/src/pulsecore/winsock.h +++ b/src/pulsecore/winsock.h @@ -15,6 +15,8 @@  #define EHOSTUNREACH    WSAEHOSTUNREACH  #define EWOULDBLOCK     WSAEWOULDBLOCK +typedef long suseconds_t; +  #endif  #ifdef HAVE_WS2TCPIP_H  | 
