From d6d9fb295d03a411974a148e469465e0f7c59891 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Tue, 4 Jan 2011 11:17:53 +0100 Subject: Clean up includes Instead should be included. That file includes poll.h on platform where it is appropriate. Also remove some unnecessary includes. --- src/daemon/main.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/main.c b/src/daemon/main.c index cad6f70d..0db794bc 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -43,10 +43,6 @@ #include #endif -#ifdef HAVE_SYS_IOCTL_H -#include -#endif - #ifdef HAVE_PWD_H #include #endif -- cgit From 4f1d4044f8409ff29eeb7f97324daba496e40714 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Tue, 4 Jan 2011 17:03:13 +0100 Subject: Use instead of The check whether POSIX socket.h or WIN32 winsock2.h must be included can be made centrally. The downside is that some functionality of e.g. arpa/inet.h is also implemented in winsock.h, so that some files that don't use socket functions, but do use inet.h functions, must also include pulsecore/socket.h. (as well as arpa/inet.h) --- src/daemon/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/daemon') diff --git a/src/daemon/main.c b/src/daemon/main.c index 0db794bc..de809b1b 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -70,7 +70,7 @@ #include #include -#include +#include #include #include #include -- cgit From 0ac0479534d9cb6e4ef734eeb3a663f33a4f8ef3 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Tue, 4 Jan 2011 17:07:50 +0100 Subject: Adapt win32 specific code to current API --- src/daemon/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/main.c b/src/daemon/main.c index de809b1b..cab275f3 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -133,7 +133,7 @@ static void message_cb(pa_mainloop_api*a, pa_time_event*e, const struct timeval } pa_timeval_add(pa_gettimeofday(&tvnext), 100000); - a->rtclock_time_restart(e, &tvnext); + a->time_restart(e, &tvnext); } #endif @@ -980,7 +980,7 @@ int main(int argc, char *argv[]) { #endif #ifdef OS_IS_WIN32 - win32_timer = pa_mainloop_get_api(mainloop)->rtclock_time_new(pa_mainloop_get_api(mainloop), pa_gettimeofday(&win32_tv), message_cb, NULL); + win32_timer = pa_mainloop_get_api(mainloop)->time_new(pa_mainloop_get_api(mainloop), pa_gettimeofday(&win32_tv), message_cb, NULL); #endif if (!conf->no_cpu_limit) -- cgit From bb12ff83564d43566089dd979639c6993ba76665 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Thu, 6 Jan 2011 00:51:33 +0100 Subject: Apply #ifdefs around functionality not available on win32 And also the reverse: around some win32 specific functionality --- src/daemon/daemon-conf.c | 5 +++++ src/daemon/dumpmodules.c | 2 ++ src/daemon/ltdl-bind-now.c | 4 ++++ src/daemon/main.c | 2 ++ 4 files changed, 13 insertions(+) (limited to 'src/daemon') diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 74e81351..3339f3b0 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -28,7 +28,10 @@ #include #include #include + +#ifdef HAVE_SCHED_H #include +#endif #include #include @@ -460,10 +463,12 @@ static int parse_rtprio(const char *filename, unsigned line, const char *section pa_assert(rvalue); pa_assert(data); +#ifdef HAVE_SCHED_H if (pa_atoi(rvalue, &rtprio) < 0 || rtprio < sched_get_priority_min(SCHED_FIFO) || rtprio > sched_get_priority_max(SCHED_FIFO)) { pa_log("[%s:%u] Invalid realtime priority '%s'.", filename, line, rvalue); return -1; } +#endif c->realtime_priority = (int) rtprio; return 0; diff --git a/src/daemon/dumpmodules.c b/src/daemon/dumpmodules.c index 92470b49..d0504dc5 100644 --- a/src/daemon/dumpmodules.c +++ b/src/daemon/dumpmodules.c @@ -90,7 +90,9 @@ static void show_info(const char *name, const char *path, void (*info)(const cha } } +#ifndef OS_IS_WIN32 extern const lt_dlsymlist lt_preloaded_symbols[]; +#endif static int is_preloaded(const char *name) { const lt_dlsymlist *l; diff --git a/src/daemon/ltdl-bind-now.c b/src/daemon/ltdl-bind-now.c index 276b2a06..2ba73ce7 100644 --- a/src/daemon/ltdl-bind-now.c +++ b/src/daemon/ltdl-bind-now.c @@ -51,6 +51,10 @@ #undef PA_BIND_NOW #endif +#ifdef OS_IS_WIN32 +#undef PA_BIND_NOW +#endif + #ifdef PA_BIND_NOW /* diff --git a/src/daemon/main.c b/src/daemon/main.c index cab275f3..5aeb9bc6 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -654,6 +654,7 @@ int main(int argc, char *argv[]) { goto finish; } +#ifdef HAVE_GETUID if (getuid() == 0 && !conf->system_instance) pa_log_warn(_("This program is not intended to be run as root (unless --system is specified).")); #ifndef HAVE_DBUS /* A similar, only a notice worthy check was done earlier, if D-Bus is enabled. */ @@ -662,6 +663,7 @@ int main(int argc, char *argv[]) { goto finish; } #endif +#endif /* HAVE_GETUID */ if (conf->cmd == PA_CMD_START && conf->system_instance) { pa_log(_("--start not supported for system instances.")); -- cgit From d6d43367053bbc0d99acd7a21a21e15a5aaae659 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Thu, 6 Jan 2011 02:10:45 +0100 Subject: Implement some functions for win32 And disable building binaries for win32 that make no sense there --- src/daemon/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/daemon') diff --git a/src/daemon/main.c b/src/daemon/main.c index 5aeb9bc6..243e7c0a 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -1078,7 +1078,7 @@ finish: } #ifdef OS_IS_WIN32 - if (win32_timer) + if (mainloop && win32_timer) pa_mainloop_get_api(mainloop)->time_free(win32_timer); #endif -- cgit From 821562b9bc8d1a9033daaae0fd5373498a085054 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Wed, 5 Jan 2011 19:50:44 +0100 Subject: Use pa_read, pa_write and pa_poll instead of system functions --- src/daemon/cpulimit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/daemon') diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c index f5042a75..c1c2a6f6 100644 --- a/src/daemon/cpulimit.c +++ b/src/daemon/cpulimit.c @@ -140,7 +140,7 @@ static void signal_handler(int sig) { write_err("Soft CPU time limit exhausted, terminating.\n"); /* Try a soft cleanup */ - (void) write(the_pipe[1], &c, sizeof(c)); + (void) pa_write(the_pipe[1], &c, sizeof(c), NULL); phase = PHASE_SOFT; reset_cpu_time(CPUTIME_INTERVAL_HARD); -- cgit