diff options
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/cmdline.c | 4 | ||||
-rw-r--r-- | src/daemon/cpulimit.c | 6 | ||||
-rw-r--r-- | src/daemon/daemon-conf.c | 76 | ||||
-rw-r--r-- | src/daemon/daemon-conf.h | 4 | ||||
-rw-r--r-- | src/daemon/main.c | 38 | ||||
-rw-r--r-- | src/daemon/server-lookup.c | 8 |
6 files changed, 68 insertions, 68 deletions
diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c index a6ceb8b80..6361a3df5 100644 --- a/src/daemon/cmdline.c +++ b/src/daemon/cmdline.c @@ -215,7 +215,7 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d case ARG_START: conf->cmd = PA_CMD_START; - conf->daemonize = TRUE; + conf->daemonize = true; break; case ARG_CHECK: @@ -318,7 +318,7 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d break; case 'n': - conf->load_default_script_file = FALSE; + conf->load_default_script_file = false; break; case ARG_LOG_TARGET: diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c index 0abbac023..7c753978d 100644 --- a/src/daemon/cpulimit.c +++ b/src/daemon/cpulimit.c @@ -80,7 +80,7 @@ static pa_io_event *io_event = NULL; static struct sigaction sigaction_prev; /* Nonzero after pa_cpu_limit_init() */ -static pa_bool_t installed = FALSE; +static bool installed = false; /* The current state of operation */ static enum { @@ -209,7 +209,7 @@ int pa_cpu_limit_init(pa_mainloop_api *m) { return -1; } - installed = TRUE; + installed = true; reset_cpu_time(CPUTIME_INTERVAL_SOFT); @@ -230,7 +230,7 @@ void pa_cpu_limit_done(void) { if (installed) { pa_assert_se(sigaction(SIGXCPU, &sigaction_prev, NULL) >= 0); - installed = FALSE; + installed = false; } } diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 4cc348571..5a480cc00 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -62,39 +62,39 @@ static const pa_daemon_conf default_conf = { .cmd = PA_CMD_DAEMON, - .daemonize = FALSE, - .fail = TRUE, - .high_priority = TRUE, + .daemonize = false, + .fail = true, + .high_priority = true, .nice_level = -11, - .realtime_scheduling = TRUE, + .realtime_scheduling = true, .realtime_priority = 5, /* Half of JACK's default rtprio */ - .disallow_module_loading = FALSE, - .disallow_exit = FALSE, - .flat_volumes = TRUE, + .disallow_module_loading = false, + .disallow_exit = false, + .flat_volumes = true, .exit_idle_time = 20, .scache_idle_time = 20, .script_commands = NULL, .dl_search_path = NULL, - .load_default_script_file = TRUE, + .load_default_script_file = true, .default_script_file = NULL, .log_target = NULL, .log_level = PA_LOG_NOTICE, .log_backtrace = 0, - .log_meta = FALSE, - .log_time = FALSE, + .log_meta = false, + .log_time = false, .resample_method = PA_RESAMPLER_AUTO, - .disable_remixing = FALSE, - .disable_lfe_remixing = TRUE, + .disable_remixing = false, + .disable_lfe_remixing = true, .config_file = NULL, - .use_pid_file = TRUE, - .system_instance = FALSE, + .use_pid_file = true, + .system_instance = false, #ifdef HAVE_DBUS .local_server_type = PA_SERVER_TYPE_UNSET, /* The actual default is _USER, but we have to detect when the user doesn't specify this option. */ #endif - .no_cpu_limit = TRUE, - .disable_shm = FALSE, - .lock_memory = FALSE, - .deferred_volume = TRUE, + .no_cpu_limit = true, + .disable_shm = false, + .lock_memory = false, + .deferred_volume = true, .default_n_fragments = 4, .default_fragment_size_msec = 25, .deferred_volume_safety_margin_usec = 8000, @@ -104,42 +104,42 @@ static const pa_daemon_conf default_conf = { .default_channel_map = { .channels = 2, .map = { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT } }, .shm_size = 0 #ifdef HAVE_SYS_RESOURCE_H - ,.rlimit_fsize = { .value = 0, .is_set = FALSE }, - .rlimit_data = { .value = 0, .is_set = FALSE }, - .rlimit_stack = { .value = 0, .is_set = FALSE }, - .rlimit_core = { .value = 0, .is_set = FALSE } + ,.rlimit_fsize = { .value = 0, .is_set = false }, + .rlimit_data = { .value = 0, .is_set = false }, + .rlimit_stack = { .value = 0, .is_set = false }, + .rlimit_core = { .value = 0, .is_set = false } #ifdef RLIMIT_RSS - ,.rlimit_rss = { .value = 0, .is_set = FALSE } + ,.rlimit_rss = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_NPROC - ,.rlimit_nproc = { .value = 0, .is_set = FALSE } + ,.rlimit_nproc = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_NOFILE - ,.rlimit_nofile = { .value = 256, .is_set = TRUE } + ,.rlimit_nofile = { .value = 256, .is_set = true } #endif #ifdef RLIMIT_MEMLOCK - ,.rlimit_memlock = { .value = 0, .is_set = FALSE } + ,.rlimit_memlock = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_AS - ,.rlimit_as = { .value = 0, .is_set = FALSE } + ,.rlimit_as = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_LOCKS - ,.rlimit_locks = { .value = 0, .is_set = FALSE } + ,.rlimit_locks = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_SIGPENDING - ,.rlimit_sigpending = { .value = 0, .is_set = FALSE } + ,.rlimit_sigpending = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_MSGQUEUE - ,.rlimit_msgqueue = { .value = 0, .is_set = FALSE } + ,.rlimit_msgqueue = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_NICE - ,.rlimit_nice = { .value = 31, .is_set = TRUE } /* nice level of -11 */ + ,.rlimit_nice = { .value = 31, .is_set = true } /* nice level of -11 */ #endif #ifdef RLIMIT_RTPRIO - ,.rlimit_rtprio = { .value = 9, .is_set = TRUE } /* One below JACK's default for the server */ + ,.rlimit_rtprio = { .value = 9, .is_set = true } /* One below JACK's default for the server */ #endif #ifdef RLIMIT_RTTIME - ,.rlimit_rttime = { .value = PA_USEC_PER_SEC, .is_set = TRUE } + ,.rlimit_rttime = { .value = PA_USEC_PER_SEC, .is_set = true } #endif #endif }; @@ -375,8 +375,8 @@ static int parse_alternate_sample_rate(pa_config_parser_state *state) { struct channel_conf_info { pa_daemon_conf *conf; - pa_bool_t default_sample_spec_set; - pa_bool_t default_channel_map_set; + bool default_sample_spec_set; + bool default_channel_map_set; }; static int parse_sample_channels(pa_config_parser_state *state) { @@ -393,7 +393,7 @@ static int parse_sample_channels(pa_config_parser_state *state) { } i->conf->default_sample_spec.channels = (uint8_t) n; - i->default_sample_spec_set = TRUE; + i->default_sample_spec_set = true; return 0; } @@ -409,7 +409,7 @@ static int parse_channel_map(pa_config_parser_state *state) { return -1; } - i->default_channel_map_set = TRUE; + i->default_channel_map_set = true; return 0; } @@ -616,7 +616,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { goto finish; } - ci.default_channel_map_set = ci.default_sample_spec_set = FALSE; + ci.default_channel_map_set = ci.default_sample_spec_set = false; ci.conf = c; r = f ? pa_config_parse(c->config_file, f, table, NULL, NULL) : 0; diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h index 067ff21b5..20225c053 100644 --- a/src/daemon/daemon-conf.h +++ b/src/daemon/daemon-conf.h @@ -52,14 +52,14 @@ typedef enum pa_daemon_conf_cmd { #ifdef HAVE_SYS_RESOURCE_H typedef struct pa_rlimit { rlim_t value; - pa_bool_t is_set; + bool is_set; } pa_rlimit; #endif /* A structure containing configuration data for the PulseAudio server . */ typedef struct pa_daemon_conf { pa_daemon_conf_cmd_t cmd; - pa_bool_t daemonize, + bool daemonize, fail, high_priority, realtime_scheduling, diff --git a/src/daemon/main.c b/src/daemon/main.c index 9bb852cbd..5b4e0053b 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -202,12 +202,12 @@ static int change_user(void) { if (!pa_streq(pw->pw_dir, PA_SYSTEM_RUNTIME_PATH)) pa_log_warn(_("Home directory of user '%s' is not '%s', ignoring."), PA_SYSTEM_USER, PA_SYSTEM_RUNTIME_PATH); - if (pa_make_secure_dir(PA_SYSTEM_RUNTIME_PATH, 0755, pw->pw_uid, gr->gr_gid, TRUE) < 0) { + if (pa_make_secure_dir(PA_SYSTEM_RUNTIME_PATH, 0755, pw->pw_uid, gr->gr_gid, true) < 0) { pa_log(_("Failed to create '%s': %s"), PA_SYSTEM_RUNTIME_PATH, pa_cstrerror(errno)); return -1; } - if (pa_make_secure_dir(PA_SYSTEM_STATE_PATH, 0700, pw->pw_uid, gr->gr_gid, TRUE) < 0) { + if (pa_make_secure_dir(PA_SYSTEM_STATE_PATH, 0700, pw->pw_uid, gr->gr_gid, true) < 0) { pa_log(_("Failed to create '%s': %s"), PA_SYSTEM_STATE_PATH, pa_cstrerror(errno)); return -1; } @@ -402,8 +402,8 @@ int main(int argc, char *argv[]) { char *s; char *configured_address; int r = 0, retval = 1, d = 0; - pa_bool_t valid_pid_file = FALSE; - pa_bool_t ltdl_init = FALSE; + bool valid_pid_file = false; + bool ltdl_init = false; int passed_fd = -1; const char *e; #ifdef HAVE_FORK @@ -415,12 +415,12 @@ int main(int argc, char *argv[]) { struct timeval win32_tv; #endif int autospawn_fd = -1; - pa_bool_t autospawn_locked = FALSE; + bool autospawn_locked = false; #ifdef HAVE_DBUS pa_dbusobj_server_lookup *server_lookup = NULL; /* /org/pulseaudio/server_lookup */ pa_dbus_connection *lookup_service_bus = NULL; /* Always the user bus. */ pa_dbus_connection *server_bus = NULL; /* The bus where we reserve org.pulseaudio.Server, either the user or the system bus. */ - pa_bool_t start_server; + bool start_server; #endif pa_log_set_ident("pulseaudio"); @@ -522,10 +522,10 @@ int main(int argc, char *argv[]) { break; case PA_SERVER_TYPE_USER: case PA_SERVER_TYPE_NONE: - conf->system_instance = FALSE; + conf->system_instance = false; break; case PA_SERVER_TYPE_SYSTEM: - conf->system_instance = TRUE; + conf->system_instance = true; break; default: pa_assert_not_reached(); @@ -535,13 +535,13 @@ int main(int argc, char *argv[]) { if (!start_server && conf->local_server_type == PA_SERVER_TYPE_SYSTEM) { pa_log_notice(_("System mode refused for non-root user. Only starting the D-Bus server lookup service.")); - conf->system_instance = FALSE; + conf->system_instance = false; } #endif LTDL_SET_PRELOADED_SYMBOLS(); pa_ltdl_init(); - ltdl_init = TRUE; + ltdl_init = true; if (conf->dl_search_path) lt_dlsetsearchpath(conf->dl_search_path); @@ -685,7 +685,7 @@ int main(int argc, char *argv[]) { * recover (i.e. autospawn) from a crash. */ char *ufn; - pa_bool_t start_anyway = FALSE; + bool start_anyway = false; if ((ufn = pa_runtime_path(PA_NATIVE_DEFAULT_UNIX_SOCKET))) { char *id; @@ -730,7 +730,7 @@ int main(int argc, char *argv[]) { if (conf->system_instance && !conf->disable_shm) { pa_log_notice(_("Running in system mode, forcibly disabling SHM mode!")); - conf->disable_shm = TRUE; + conf->disable_shm = true; } if (conf->system_instance && conf->exit_idle_time >= 0) { @@ -748,12 +748,12 @@ int main(int argc, char *argv[]) { goto finish; } - if ((pa_autospawn_lock_acquire(TRUE) < 0)) { + if ((pa_autospawn_lock_acquire(true) < 0)) { pa_log("Failed to acquire autospawn lock"); goto finish; } - autospawn_locked = TRUE; + autospawn_locked = true; } if (conf->daemonize) { @@ -806,9 +806,9 @@ int main(int argc, char *argv[]) { * to close it in the child */ pa_autospawn_lock_release(); - pa_autospawn_lock_done(TRUE); + pa_autospawn_lock_done(true); - autospawn_locked = FALSE; + autospawn_locked = false; autospawn_fd = -1; } @@ -992,7 +992,7 @@ int main(int argc, char *argv[]) { goto finish; } - valid_pid_file = TRUE; + valid_pid_file = true; } pa_disable_sigpipe(); @@ -1110,7 +1110,7 @@ int main(int argc, char *argv[]) { * any modules to be loaded. We haven't loaded any so far, so one might * think there's no way to contact the server, but receiving certain * signals could still cause modules to load. */ - conf->disallow_module_loading = TRUE; + conf->disallow_module_loading = true; } #endif @@ -1161,7 +1161,7 @@ finish: if (autospawn_locked) pa_autospawn_lock_release(); - pa_autospawn_lock_done(FALSE); + pa_autospawn_lock_done(false); } #ifdef OS_IS_WIN32 diff --git a/src/daemon/server-lookup.c b/src/daemon/server-lookup.c index 9bdc69919..82c88510a 100644 --- a/src/daemon/server-lookup.c +++ b/src/daemon/server-lookup.c @@ -42,7 +42,7 @@ struct pa_dbusobj_server_lookup { pa_core *core; pa_dbus_connection *conn; - pa_bool_t path_registered; + bool path_registered; }; static const char introspection[] = @@ -82,7 +82,7 @@ static void unregister_cb(DBusConnection *conn, void *user_data) { pa_assert(sl); pa_assert(sl->path_registered); - sl->path_registered = FALSE; + sl->path_registered = false; } static DBusHandlerResult handle_introspect(DBusConnection *conn, DBusMessage *msg, pa_dbusobj_server_lookup *sl) { @@ -482,7 +482,7 @@ pa_dbusobj_server_lookup *pa_dbusobj_server_lookup_new(pa_core *c) { sl = pa_xnew(pa_dbusobj_server_lookup, 1); sl->core = c; - sl->path_registered = FALSE; + sl->path_registered = false; if (!(sl->conn = pa_dbus_bus_get(c, DBUS_BUS_SESSION, &error)) || dbus_error_is_set(&error)) { pa_log_warn("Unable to contact D-Bus: %s: %s", error.name, error.message); @@ -494,7 +494,7 @@ pa_dbusobj_server_lookup *pa_dbusobj_server_lookup_new(pa_core *c) { goto fail; } - sl->path_registered = TRUE; + sl->path_registered = true; return sl; |