[pulseaudio-commits] 6 commits - configure.ac man/pulseaudio.1.xml.in src/daemon src/Makefile.am src/modules src/pulse src/pulsecore src/tests
Arun Raghavan
arun at kemper.freedesktop.org
Fri Sep 25 05:02:35 PDT 2015
configure.ac | 2 -
man/pulseaudio.1.xml.in | 4 ++
src/Makefile.am | 36 +++++++++++++-------------
src/daemon/cmdline.c | 2 -
src/daemon/daemon-conf.c | 2 -
src/daemon/main.c | 10 ++++++-
src/daemon/systemd/user/pulseaudio.service.in | 2 +
src/modules/alsa/alsa-mixer.c | 4 +-
src/modules/dbus/iface-core.c | 2 -
src/modules/macosx/module-coreaudio-device.c | 4 +-
src/modules/module-rygel-media-server.c | 2 -
src/modules/module-udev-detect.c | 2 -
src/modules/rtp/headerlist.c | 2 -
src/modules/rtp/rtsp_client.c | 6 ++--
src/modules/x11/module-x11-publish.c | 2 -
src/pulse/proplist.c | 2 -
src/pulse/pulseaudio.h | 8 +++++
src/pulsecore/cli-text.c | 18 ++++++-------
src/pulsecore/cli.c | 2 -
src/pulsecore/core-util.c | 19 ++++++++++---
src/pulsecore/log.c | 7 +++++
src/pulsecore/protocol-dbus.c | 4 +-
src/pulsecore/protocol-http.c | 2 -
src/pulsecore/resampler.c | 2 -
src/pulsecore/strbuf.c | 8 ++---
src/pulsecore/strbuf.h | 4 +-
src/pulsecore/strlist.c | 4 +-
src/pulsecore/strlist.h | 2 -
src/tests/memblockq-test.c | 4 +-
src/tests/strlist-test.c | 6 ++--
30 files changed, 106 insertions(+), 68 deletions(-)
New commits:
commit ac5b7b8d5cbf53c68fb39ae27f54a69894d50d01
Author: Ahmed S. Darwish <darwish.07 at gmail.com>
Date: Fri Aug 14 18:47:32 2015 +0200
log: Introduce PULSE_LOG_JOURNAL environment variable
By introducing such an environment variable, applications using the
PA client libraries can configure these libraries to send their logs
directly to the journal.
While client libraries journal logging can be indirectly achieved
using PULSE_LOG_SYSLOG, this pollutes the journal. Meta data gets
replicated twice: once in the journal meta fields and once in the
syslog(3) plain-text message itself.
For attaching any backtraces, also introduce the PA-specific journal
meta field PULSE_BACKTRACE. This is the recommend journal practice
instead of appending any furuther data to the logging message itself.
Signed-off-by: Ahmed S. Darwish <darwish.07 at gmail.com>
diff --git a/src/pulse/pulseaudio.h b/src/pulse/pulseaudio.h
index f5c5b0d..5077e3b 100644
--- a/src/pulse/pulseaudio.h
+++ b/src/pulse/pulseaudio.h
@@ -140,6 +140,14 @@
* - `PULSE_LOG_SYSLOG`: If defined, force all client libraries to log
* their output using the syslog(3) mechanism. Default behavior is to
* log all output to stderr.
+ * - `PULSE_LOG_JOURNAL`: If defined, force all client libraries to log
+ * their output using the systemd journal. If both `PULSE_LOG_JOURNAL`
+ * and `PULSE_LOG_SYSLOG` are defined, logging to the systemd journal
+ * takes a higher precedence. Each message originating library file name
+ * and function are included by default through the journal fields
+ * `CODE_FILE`, `CODE_FUNC`, and `CODE_LINE`. Any backtrace attached to
+ * the logging message is sent through the PulseAudio-specific journal
+ * field `PULSE_BACKTRACE`.
* - `PULSE_LOG_COLORS`: If defined, enables colored logging output.
* - `PULSE_LOG_TIME`: If defined, include timestamps with each message.
* - `PULSE_LOG_FILE`: If defined, include each message originating file
diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index 552d416..34ed041 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -60,6 +60,7 @@
#include "log.h"
#define ENV_LOG_SYSLOG "PULSE_LOG_SYSLOG"
+#define ENV_LOG_JOURNAL "PULSE_LOG_JOURNAL"
#define ENV_LOG_LEVEL "PULSE_LOG"
#define ENV_LOG_COLORS "PULSE_LOG_COLORS"
#define ENV_LOG_PRINT_TIME "PULSE_LOG_TIME"
@@ -293,6 +294,11 @@ static void init_defaults(void) {
target_override_set = true;
}
+ if (getenv(ENV_LOG_JOURNAL)) {
+ target_override = PA_LOG_JOURNAL;
+ target_override_set = true;
+ }
+
if ((e = getenv(ENV_LOG_LEVEL))) {
maximum_level_override = (pa_log_level_t) atoi(e);
@@ -493,6 +499,7 @@ void pa_log_levelv_meta(
"CODE_FILE=%s", file,
"CODE_FUNC=%s", func,
"CODE_LINE=%d", line,
+ "PULSE_BACKTRACE=%s", pa_strempty(bt),
NULL) < 0) {
#ifdef HAVE_SYSLOG_H
pa_log_target new_target = { .type = PA_LOG_SYSLOG, .file = NULL };
commit c93903d99a9084ff1e37feb6ae6085ced75466b1
Author: Felipe Sateler <fsateler at debian.org>
Date: Thu Aug 13 19:58:28 2015 -0300
pulseaudio.1: document that systemd notification only works without daemonization
diff --git a/man/pulseaudio.1.xml.in b/man/pulseaudio.1.xml.in
index e6291d8..650b417 100644
--- a/man/pulseaudio.1.xml.in
+++ b/man/pulseaudio.1.xml.in
@@ -130,7 +130,9 @@ License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
<p><opt>-D | --daemonize</opt><arg>[=BOOL]</arg></p>
<optdesc><p>Daemonize after startup, i.e. detach from the
- terminal.</p></optdesc>
+ terminal. Note that when running as a systemd service you should
+ use <opt>--daemonize=no</opt> for systemd notification to work.
+ </p></optdesc>
</option>
<option>
commit ad047c2c795555fd86b971369e504e63c4b554bd
Author: Felipe Sateler <fsateler at debian.org>
Date: Thu Aug 13 19:58:27 2015 -0300
daemon: Use Type=notify for systemd service
This ensures systemd knows when pulseaudio finishes loading, thus never
marking pulseaudio as active if startup fails.
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 6f7be7a..c7b15e7 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -1131,12 +1131,20 @@ int main(int argc, char *argv[]) {
pa_log_info("Daemon startup complete.");
+#ifdef HAVE_SYSTEMD_DAEMON
+ sd_notify(0, "READY=1");
+#endif
+
retval = 0;
if (pa_mainloop_run(mainloop, &retval) < 0)
goto finish;
pa_log_info("Daemon shutdown initiated.");
+#ifdef HAVE_SYSTEMD_DAEMON
+ sd_notify(0, "STOPPING=1");
+#endif
+
finish:
#ifdef HAVE_DBUS
if (server_bus)
diff --git a/src/daemon/systemd/user/pulseaudio.service.in b/src/daemon/systemd/user/pulseaudio.service.in
index e08ff1e..df42fc3 100644
--- a/src/daemon/systemd/user/pulseaudio.service.in
+++ b/src/daemon/systemd/user/pulseaudio.service.in
@@ -2,6 +2,8 @@
Description=Sound Service
[Service]
+# Note that notify will only work if --daemonize=no
+Type=notify
ExecStart=@PA_BINARY@ --daemonize=no
Restart=on-failure
commit 2d5eec2d2c5d994ede44665a940ddceb0c8e0e86
Author: Deepak Srivastava <srivastava.d at samsung.com>
Date: Fri Jun 12 18:17:07 2015 +0530
Rename functions with "tostring" in the name to one with "to_string" to conform with the convention.
component: core
<EP-E358F00C1D9A449EAE69225B9D2530F8>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88833
Signed-off-by: Deepak Srivastava <srivastava.d at samsung.com>
diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c
index 68a02e3..117147d 100644
--- a/src/daemon/cmdline.c
+++ b/src/daemon/cmdline.c
@@ -395,7 +395,7 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d
}
pa_xfree(conf->script_commands);
- conf->script_commands = pa_strbuf_tostring_free(buf);
+ conf->script_commands = pa_strbuf_to_string_free(buf);
*d = optind;
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 21a8edb..f94cdeb 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -804,5 +804,5 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
pa_xfree(log_target);
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 8137121..6f7be7a 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -1082,7 +1082,7 @@ int main(int argc, char *argv[]) {
if (r >= 0)
r = pa_cli_command_execute(c, conf->script_commands, buf, &conf->fail);
- pa_log_error("%s", s = pa_strbuf_tostring_free(buf));
+ pa_log_error("%s", s = pa_strbuf_to_string_free(buf));
pa_xfree(s);
if (r < 0 && conf->fail) {
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 425c5e6..9e06ba4 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -4273,7 +4273,7 @@ static int profile_verify(pa_alsa_profile *p) {
pa_strbuf_printf(sb, _("%s Input"), m->description);
}
- p->description = pa_strbuf_tostring_free(sb);
+ p->description = pa_strbuf_to_string_free(sb);
}
return 0;
@@ -4333,7 +4333,7 @@ void pa_alsa_decibel_fix_dump(pa_alsa_decibel_fix *db_fix) {
for (i = 0; i < nsteps; ++i)
pa_strbuf_printf(buf, "[%li]:%0.2f ", i + db_fix->min_step, db_fix->db_values[i] / 100.0);
- db_values = pa_strbuf_tostring_free(buf);
+ db_values = pa_strbuf_to_string_free(buf);
}
pa_log_debug("Decibel fix %s, min_step=%li, max_step=%li, db_values=%s",
diff --git a/src/modules/dbus/iface-core.c b/src/modules/dbus/iface-core.c
index d29c70a..1b14195 100644
--- a/src/modules/dbus/iface-core.c
+++ b/src/modules/dbus/iface-core.c
@@ -1504,7 +1504,7 @@ static void handle_load_module(DBusConnection *conn, DBusMessage *msg, void *use
dbus_message_iter_next(&dict_iter);
}
- arg_string = pa_strbuf_tostring(arg_buffer);
+ arg_string = pa_strbuf_to_string(arg_buffer);
if (!(module = pa_module_load(c->core, name, arg_string))) {
pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Failed to load module.");
diff --git a/src/modules/macosx/module-coreaudio-device.c b/src/modules/macosx/module-coreaudio-device.c
index cb62661..cbf1f27 100644
--- a/src/modules/macosx/module-coreaudio-device.c
+++ b/src/modules/macosx/module-coreaudio-device.c
@@ -411,7 +411,7 @@ static int ca_device_create_sink(pa_module *m, AudioBuffer *buf, int channel_idx
pa_strbuf_puts(strbuf, tmp);
}
- ca_sink->name = pa_strbuf_tostring_free(strbuf);
+ ca_sink->name = pa_strbuf_to_string_free(strbuf);
pa_log_debug("Stream name is >%s<", ca_sink->name);
@@ -529,7 +529,7 @@ static int ca_device_create_source(pa_module *m, AudioBuffer *buf, int channel_i
pa_strbuf_puts(strbuf, tmp);
}
- ca_source->name = pa_strbuf_tostring_free(strbuf);
+ ca_source->name = pa_strbuf_to_string_free(strbuf);
pa_log_debug("Stream name is >%s<", ca_source->name);
diff --git a/src/modules/module-rygel-media-server.c b/src/modules/module-rygel-media-server.c
index 0baf3c8..e2c2e6f 100644
--- a/src/modules/module-rygel-media-server.c
+++ b/src/modules/module-rygel-media-server.c
@@ -937,7 +937,7 @@ static DBusHandlerResult sinks_and_sources_handler(DBusConnection *c, DBusMessag
}
pa_strbuf_puts(sb, CONTAINER_INTROSPECT_XML_POSTFIX);
- xml = pa_strbuf_tostring_free(sb);
+ xml = pa_strbuf_to_string_free(sb);
pa_assert_se(r = dbus_message_new_method_return(m));
pa_assert_se(dbus_message_append_args(r, DBUS_TYPE_STRING, &xml, DBUS_TYPE_INVALID));
diff --git a/src/modules/module-udev-detect.c b/src/modules/module-udev-detect.c
index df0d187..bb41a96 100644
--- a/src/modules/module-udev-detect.c
+++ b/src/modules/module-udev-detect.c
@@ -421,7 +421,7 @@ static void card_changed(struct userdata *u, struct udev_device *dev) {
if (u->tsched_buffer_size_valid)
pa_strbuf_printf(args_buf, " tsched_buffer_size=%" PRIu32, u->tsched_buffer_size);
- d->args = pa_strbuf_tostring_free(args_buf);
+ d->args = pa_strbuf_to_string_free(args_buf);
pa_hashmap_put(u->devices, d->path, d);
diff --git a/src/modules/rtp/headerlist.c b/src/modules/rtp/headerlist.c
index 2ea7226..1fb0b41 100644
--- a/src/modules/rtp/headerlist.c
+++ b/src/modules/rtp/headerlist.c
@@ -159,7 +159,7 @@ char *pa_headerlist_to_string(pa_headerlist *p) {
pa_strbuf_printf(buf, "%s: %s\r\n", key, v);
}
- return pa_strbuf_tostring_free(buf);
+ return pa_strbuf_to_string_free(buf);
}
int pa_headerlist_contains(pa_headerlist *p, const char *key) {
diff --git a/src/modules/rtp/rtsp_client.c b/src/modules/rtp/rtsp_client.c
index a279aee..bdfd24f 100644
--- a/src/modules/rtp/rtsp_client.c
+++ b/src/modules/rtp/rtsp_client.c
@@ -205,7 +205,7 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
/* End of headers */
/* We will have a header left from our looping iteration, so add it in :) */
if (c->last_header) {
- char *tmp = pa_strbuf_tostring_free(c->header_buffer);
+ char *tmp = pa_strbuf_to_string_free(c->header_buffer);
/* This is not a continuation header so let's dump it into our proplist */
pa_headerlist_puts(c->response_headers, c->last_header, tmp);
pa_xfree(tmp);
@@ -233,7 +233,7 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
}
if (c->last_header) {
- char *tmp = pa_strbuf_tostring_free(c->header_buffer);
+ char *tmp = pa_strbuf_to_string_free(c->header_buffer);
/* This is not a continuation header so let's dump the full
header/value into our proplist */
pa_headerlist_puts(c->response_headers, c->last_header, tmp);
@@ -432,7 +432,7 @@ static int rtsp_exec(pa_rtsp_client* c, const char* cmd,
}
/* Our packet is created... now we can send it :) */
- hdrs = pa_strbuf_tostring_free(buf);
+ hdrs = pa_strbuf_to_string_free(buf);
/*pa_log_debug("Submitting request:");
pa_log_debug(hdrs);*/
pa_ioline_puts(c->ioline, hdrs);
diff --git a/src/modules/x11/module-x11-publish.c b/src/modules/x11/module-x11-publish.c
index 418c6c9..553b341 100644
--- a/src/modules/x11/module-x11-publish.c
+++ b/src/modules/x11/module-x11-publish.c
@@ -83,7 +83,7 @@ static void publish_servers(struct userdata *u, pa_strlist *l) {
char *s;
l = pa_strlist_reverse(l);
- s = pa_strlist_tostring(l);
+ s = pa_strlist_to_string(l);
pa_strlist_reverse(l);
pa_x11_set_prop(pa_x11_wrapper_get_xcb_connection(u->x11_wrapper), screen, "PULSE_SERVER", s);
diff --git a/src/pulse/proplist.c b/src/pulse/proplist.c
index 6111661..4e2901b 100644
--- a/src/pulse/proplist.c
+++ b/src/pulse/proplist.c
@@ -435,7 +435,7 @@ char *pa_proplist_to_string_sep(pa_proplist *p, const char *sep) {
}
}
- return pa_strbuf_tostring_free(buf);
+ return pa_strbuf_to_string_free(buf);
}
char *pa_proplist_to_string(pa_proplist *p) {
diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
index d296692..af79a1e 100644
--- a/src/pulsecore/cli-text.c
+++ b/src/pulsecore/cli-text.c
@@ -68,7 +68,7 @@ char *pa_module_list_to_string(pa_core *c) {
pa_xfree(t);
}
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
char *pa_client_list_to_string(pa_core *c) {
@@ -98,7 +98,7 @@ char *pa_client_list_to_string(pa_core *c) {
pa_xfree(t);
}
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
static const char *available_to_string(pa_available_t a) {
@@ -193,7 +193,7 @@ char *pa_card_list_to_string(pa_core *c) {
append_port_list(s, card->ports);
}
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
static const char *sink_state_to_string(pa_sink_state_t state) {
@@ -345,7 +345,7 @@ char *pa_sink_list_to_string(pa_core *c) {
sink->active_port->name);
}
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
char *pa_source_list_to_string(pa_core *c) {
@@ -460,7 +460,7 @@ char *pa_source_list_to_string(pa_core *c) {
source->active_port->name);
}
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
char *pa_source_output_list_to_string(pa_core *c) {
@@ -557,7 +557,7 @@ char *pa_source_output_list_to_string(pa_core *c) {
pa_xfree(t);
}
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
char *pa_sink_input_list_to_string(pa_core *c) {
@@ -653,7 +653,7 @@ char *pa_sink_input_list_to_string(pa_core *c) {
pa_xfree(t);
}
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
char *pa_scache_list_to_string(pa_core *c) {
@@ -712,7 +712,7 @@ char *pa_scache_list_to_string(pa_core *c) {
}
}
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
char *pa_full_status_string(pa_core *c) {
@@ -755,5 +755,5 @@ char *pa_full_status_string(pa_core *c) {
pa_xfree(t);
}
- return pa_strbuf_tostring_free(s);
+ return pa_strbuf_to_string_free(s);
}
diff --git a/src/pulsecore/cli.c b/src/pulsecore/cli.c
index d72642f..f942629 100644
--- a/src/pulsecore/cli.c
+++ b/src/pulsecore/cli.c
@@ -152,7 +152,7 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
else
pa_cli_command_execute_line(c->core, s, buf, &c->fail);
c->defer_kill--;
- pa_ioline_puts(line, p = pa_strbuf_tostring_free(buf));
+ pa_ioline_puts(line, p = pa_strbuf_to_string_free(buf));
pa_xfree(p);
if (c->kill_requested) {
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index f5857e0..278ad63 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -3202,7 +3202,7 @@ char *pa_replace(const char*s, const char*a, const char *b) {
pa_strbuf_puts(sb, s);
- return pa_strbuf_tostring_free(sb);
+ return pa_strbuf_to_string_free(sb);
}
char *pa_escape(const char *p, const char *chars) {
@@ -3224,7 +3224,7 @@ char *pa_escape(const char *p, const char *chars) {
pa_strbuf_putc(buf, *s);
}
- return pa_strbuf_tostring_free(buf);
+ return pa_strbuf_to_string_free(buf);
}
char *pa_unescape(char *p) {
diff --git a/src/pulsecore/protocol-dbus.c b/src/pulsecore/protocol-dbus.c
index d07d067..59afc1a 100644
--- a/src/pulsecore/protocol-dbus.c
+++ b/src/pulsecore/protocol-dbus.c
@@ -257,7 +257,7 @@ static void update_introspection(struct object_entry *oe) {
pa_strbuf_puts(buf, "</node>\n");
pa_xfree(oe->introspection);
- oe->introspection = pa_strbuf_tostring_free(buf);
+ oe->introspection = pa_strbuf_to_string_free(buf);
}
/* Return value of find_handler() and its subfunctions. */
@@ -689,7 +689,7 @@ static pa_hashmap *extract_method_signatures(pa_hashmap *method_handlers) {
pa_strbuf_puts(sig_buf, handler->arguments[i].type);
}
- pa_hashmap_put(signatures, (char *) handler->method_name, pa_strbuf_tostring_free(sig_buf));
+ pa_hashmap_put(signatures, (char *) handler->method_name, pa_strbuf_to_string_free(sig_buf));
}
return signatures;
diff --git a/src/pulsecore/protocol-http.c b/src/pulsecore/protocol-http.c
index da8e220..25a2cd0 100644
--- a/src/pulsecore/protocol-http.c
+++ b/src/pulsecore/protocol-http.c
@@ -294,7 +294,7 @@ static char *escape_html(const char *t) {
if (p > e)
pa_strbuf_putsn(sb, e, p-e);
- return pa_strbuf_tostring_free(sb);
+ return pa_strbuf_to_string_free(sb);
}
static void http_response(
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index 5478e6d..bf3fdb8 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -1149,7 +1149,7 @@ static void setup_remap(const pa_resampler *r, pa_remap_t *m, bool *lfe_remixed)
pa_strbuf_puts(s, "\n");
}
- pa_log_debug("Channel matrix:\n%s", t = pa_strbuf_tostring_free(s));
+ pa_log_debug("Channel matrix:\n%s", t = pa_strbuf_to_string_free(s));
pa_xfree(t);
/* initialize the remapping function */
diff --git a/src/pulsecore/strbuf.c b/src/pulsecore/strbuf.c
index adcd3eb..11f131b 100644
--- a/src/pulsecore/strbuf.c
+++ b/src/pulsecore/strbuf.c
@@ -69,7 +69,7 @@ void pa_strbuf_free(pa_strbuf *sb) {
/* Make a C string from the string buffer. The caller has to free
* string with pa_xfree(). */
-char *pa_strbuf_tostring(pa_strbuf *sb) {
+char *pa_strbuf_to_string(pa_strbuf *sb) {
char *t, *e;
struct chunk *c;
@@ -91,12 +91,12 @@ char *pa_strbuf_tostring(pa_strbuf *sb) {
return t;
}
-/* Combination of pa_strbuf_free() and pa_strbuf_tostring() */
-char *pa_strbuf_tostring_free(pa_strbuf *sb) {
+/* Combination of pa_strbuf_free() and pa_strbuf_to_string() */
+char *pa_strbuf_to_string_free(pa_strbuf *sb) {
char *t;
pa_assert(sb);
- t = pa_strbuf_tostring(sb);
+ t = pa_strbuf_to_string(sb);
pa_strbuf_free(sb);
return t;
diff --git a/src/pulsecore/strbuf.h b/src/pulsecore/strbuf.h
index 562fe38..469f6f7 100644
--- a/src/pulsecore/strbuf.h
+++ b/src/pulsecore/strbuf.h
@@ -27,8 +27,8 @@ typedef struct pa_strbuf pa_strbuf;
pa_strbuf *pa_strbuf_new(void);
void pa_strbuf_free(pa_strbuf *sb);
-char *pa_strbuf_tostring(pa_strbuf *sb);
-char *pa_strbuf_tostring_free(pa_strbuf *sb);
+char *pa_strbuf_to_string(pa_strbuf *sb);
+char *pa_strbuf_to_string_free(pa_strbuf *sb);
size_t pa_strbuf_printf(pa_strbuf *sb, const char *format, ...) PA_GCC_PRINTF_ATTR(2,3);
void pa_strbuf_puts(pa_strbuf *sb, const char *t);
diff --git a/src/pulsecore/strlist.c b/src/pulsecore/strlist.c
index 37e4847..7e5b070 100644
--- a/src/pulsecore/strlist.c
+++ b/src/pulsecore/strlist.c
@@ -50,7 +50,7 @@ pa_strlist* pa_strlist_prepend(pa_strlist *l, const char *s) {
return n;
}
-char *pa_strlist_tostring(pa_strlist *l) {
+char *pa_strlist_to_string(pa_strlist *l) {
int first = 1;
pa_strbuf *b;
@@ -62,7 +62,7 @@ char *pa_strlist_tostring(pa_strlist *l) {
pa_strbuf_puts(b, ITEM_TO_TEXT(l));
}
- return pa_strbuf_tostring_free(b);
+ return pa_strbuf_to_string_free(b);
}
pa_strlist* pa_strlist_remove(pa_strlist *l, const char *s) {
diff --git a/src/pulsecore/strlist.h b/src/pulsecore/strlist.h
index 84a5777..3cc71e8 100644
--- a/src/pulsecore/strlist.h
+++ b/src/pulsecore/strlist.h
@@ -29,7 +29,7 @@ pa_strlist* pa_strlist_prepend(pa_strlist *l, const char *s);
pa_strlist* pa_strlist_remove(pa_strlist *l, const char *s);
/* Make a whitespace separated string of all server strings. Returned memory has to be freed with pa_xfree() */
-char *pa_strlist_tostring(pa_strlist *l);
+char *pa_strlist_to_string(pa_strlist *l);
/* Free the entire list */
void pa_strlist_free(pa_strlist *l);
diff --git a/src/tests/memblockq-test.c b/src/tests/memblockq-test.c
index a65b097..eea6cfa 100644
--- a/src/tests/memblockq-test.c
+++ b/src/tests/memblockq-test.c
@@ -70,7 +70,7 @@ static void dump(pa_memblockq *bq, int n) {
buf = pa_strbuf_new();
dump_chunk(&out, buf);
pa_memblock_unref(out.memblock);
- str = pa_strbuf_tostring_free(buf);
+ str = pa_strbuf_to_string_free(buf);
fail_unless(pa_streq(str, fixed[n]));
pa_xfree(str);
fprintf(stderr, "<\n");
@@ -87,7 +87,7 @@ static void dump(pa_memblockq *bq, int n) {
pa_memblock_unref(out.memblock);
pa_memblockq_drop(bq, out.length);
}
- str = pa_strbuf_tostring_free(buf);
+ str = pa_strbuf_to_string_free(buf);
fail_unless(pa_streq(str, manual[n]));
pa_xfree(str);
fprintf(stderr, "<\n");
diff --git a/src/tests/strlist-test.c b/src/tests/strlist-test.c
index 6a4f4bb..f4ec1c3 100644
--- a/src/tests/strlist-test.c
+++ b/src/tests/strlist-test.c
@@ -20,7 +20,7 @@ START_TEST (strlist_test) {
l = pa_strlist_prepend(l, "b");
l = pa_strlist_prepend(l, "a");
- t = pa_strlist_tostring(l);
+ t = pa_strlist_to_string(l);
pa_strlist_free(l);
fprintf(stderr, "1: %s\n", t);
@@ -29,7 +29,7 @@ START_TEST (strlist_test) {
l = pa_strlist_parse(t);
pa_xfree(t);
- t = pa_strlist_tostring(l);
+ t = pa_strlist_to_string(l);
fprintf(stderr, "2: %s\n", t);
fail_unless(pa_streq(t, "a b c d e"));
pa_xfree(t);
@@ -41,7 +41,7 @@ START_TEST (strlist_test) {
l = pa_strlist_remove(l, "c");
- t = pa_strlist_tostring(l);
+ t = pa_strlist_to_string(l);
fprintf(stderr, "4: %s\n", t);
fail_unless(pa_streq(t, "b d e"));
pa_xfree(t);
commit bb88d9095052cd1af7cc7d68c8fc2d47c63ec1e0
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date: Tue Jun 9 21:56:36 2015 +0200
core: Fallbacks for machine-id in filesystem
see https://bugs.freedesktop.org/show_bug.cgi?id=88834
Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index ba31221..f5857e0 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -3060,12 +3060,21 @@ char *pa_machine_id(void) {
/* The returned value is supposed be some kind of ascii identifier
* that is unique and stable across reboots. */
- /* First we try the /etc/machine-id, which is the best option we
- * have, since it fits perfectly our needs and is not as volatile
+ /* First we try ${sysconfdir}/etc/machine-id, with fallbacks to
+ * ${localstatedir}/lib/dbus/machine-id, /etc/machine-id and
+ * /var/lib/dbus/machine-id, which are the best option we
+ * have, since they fit perfectly our needs and are not as volatile
* as the hostname which might be set from dhcp. */
if ((f = pa_fopen_cloexec(PA_MACHINE_ID, "r")) ||
- (f = pa_fopen_cloexec(PA_MACHINE_ID_FALLBACK, "r"))) {
+ (f = pa_fopen_cloexec(PA_MACHINE_ID_FALLBACK, "r")) ||
+#if !defined(OS_IS_WIN32)
+ (f = pa_fopen_cloexec("/etc/machine-id", "r")) ||
+ (f = pa_fopen_cloexec("/var/lib/dbus/machine-id", "r"))
+#else
+ false
+#endif
+ ) {
char ln[34] = "", *r;
r = fgets(ln, sizeof(ln)-1, f);
commit b727dd540b96ecf62fc0ef411dcea1049f235093
Author: Shawn Walker <shawn.walker at oracle.com>
Date: Tue Aug 11 16:22:37 2015 +0200
build-sys: don't use the nodelete linker flag on executables
The nodelete flag indicates that we don't want our libraries to be
unloaded. It's only relevant on libraries, so let's not use it for
executables. Trying to use it on executables breaks things on some
platforms.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90878
diff --git a/configure.ac b/configure.ac
index fa8ea1c..dac52c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -212,7 +212,7 @@ AC_SUBST([IMMEDIATE_LDFLAGS])
# On ELF systems we don't want the libraries to be unloaded since we don't clean them up properly,
# so we request the nodelete flag to be enabled.
# On other systems, we don't really know how to do that, but it's welcome if somebody can tell.
-AX_APPEND_LINK_FLAGS([-Wl,-z,nodelete], [NODELETE_LDFLAGS])
+AX_APPEND_LINK_FLAGS([-Wl,-z,nodelete], [NODELETE_LDFLAGS], [-shared])
AC_SUBST([NODELETE_LDFLAGS])
# Check for the proper way to build libraries that have no undefined symbols
diff --git a/src/Makefile.am b/src/Makefile.am
index 9df5ddd..0c58d37 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,7 +54,9 @@ SERVER_CFLAGS = -D__INCLUDED_FROM_PULSE_AUDIO
AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS)
AM_LDADD = $(PTHREAD_LIBS) $(INTLLIBS)
-AM_LDFLAGS = $(NODELETE_LDFLAGS)
+AM_LDFLAGS =
+# Should only be applied to libraries.
+AM_LIBLDFLAGS = $(NODELETE_LDFLAGS)
if HAVE_GCOV
AM_CFLAGS+=$(GCOV_CFLAGS)
@@ -77,7 +79,7 @@ endif
FOREIGN_CFLAGS = -w
-MODULE_LDFLAGS = $(AM_LDFLAGS) -module -disable-static -avoid-version $(NOUNDEFINED_LDFLAGS)
+MODULE_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -module -disable-static -avoid-version $(NOUNDEFINED_LDFLAGS)
MODULE_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
###################################
@@ -720,7 +722,7 @@ libpulsecommon_ at PA_MAJORMINOR@_la_SOURCES += pulsecore/poll-posix.c pulsecore/po
endif
libpulsecommon_ at PA_MAJORMINOR@_la_CFLAGS = $(AM_CFLAGS) $(LIBJSON_CFLAGS) $(LIBSNDFILE_CFLAGS)
-libpulsecommon_ at PA_MAJORMINOR@_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libpulsecommon_ at PA_MAJORMINOR@_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libpulsecommon_ at PA_MAJORMINOR@_la_LIBADD = $(AM_LIBADD) $(LIBJSON_LIBS) $(LIBWRAP_LIBS) $(WINSOCK_LIBS) $(LTLIBICONV) $(LIBSNDFILE_LIBS)
if HAVE_X11
@@ -870,7 +872,7 @@ libpulse_la_SOURCES = \
libpulse_la_CFLAGS = $(AM_CFLAGS) $(LIBJSON_CFLAGS)
libpulse_la_LIBADD = $(AM_LIBADD) $(WINSOCK_LIBS) $(LTLIBICONV) $(LIBJSON_LIBS) libpulsecommon- at PA_MAJORMINOR@.la
-libpulse_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_VERSION_INFO)
+libpulse_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_VERSION_INFO)
if HAVE_DBUS
libpulse_la_CFLAGS += $(DBUS_CFLAGS)
@@ -880,12 +882,12 @@ endif
libpulse_simple_la_SOURCES = pulse/simple.c pulse/simple.h
libpulse_simple_la_CFLAGS = $(AM_CFLAGS)
libpulse_simple_la_LIBADD = $(AM_LIBADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la
-libpulse_simple_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_SIMPLE_VERSION_INFO)
+libpulse_simple_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_SIMPLE_VERSION_INFO)
libpulse_mainloop_glib_la_SOURCES = pulse/glib-mainloop.h pulse/glib-mainloop.c
libpulse_mainloop_glib_la_CFLAGS = $(AM_CFLAGS) $(GLIB20_CFLAGS)
libpulse_mainloop_glib_la_LIBADD = $(AM_LIBADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la $(GLIB20_LIBS)
-libpulse_mainloop_glib_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_MAINLOOP_GLIB_VERSION_INFO)
+libpulse_mainloop_glib_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_MAINLOOP_GLIB_VERSION_INFO)
###################################
# OSS emulation #
@@ -909,7 +911,7 @@ endif
libpulsedsp_la_SOURCES = utils/padsp.c
libpulsedsp_la_CFLAGS = $(AM_CFLAGS)
libpulsedsp_la_LIBADD = $(AM_LIBADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la
-libpulsedsp_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -disable-static
+libpulsedsp_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version -disable-static
###################################
# Daemon core library #
@@ -972,7 +974,7 @@ libpulsecore_ at PA_MAJORMINOR@_la_SOURCES = \
pulsecore/database.h
libpulsecore_ at PA_MAJORMINOR@_la_CFLAGS = $(AM_CFLAGS) $(SERVER_CFLAGS) $(LIBSNDFILE_CFLAGS) $(WINSOCK_CFLAGS)
-libpulsecore_ at PA_MAJORMINOR@_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libpulsecore_ at PA_MAJORMINOR@_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libpulsecore_ at PA_MAJORMINOR@_la_LIBADD = $(AM_LIBADD) $(LIBLTDL) $(LIBSNDFILE_LIBS) $(WINSOCK_LIBS) $(LTLIBICONV) libpulsecommon- at PA_MAJORMINOR@.la libpulse.la libpulsecore-foreign.la
if HAVE_NEON
@@ -1087,24 +1089,24 @@ modlibexec_LTLIBRARIES += \
endif
libprotocol_simple_la_SOURCES = pulsecore/protocol-simple.c pulsecore/protocol-simple.h
-libprotocol_simple_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libprotocol_simple_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libprotocol_simple_la_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
libcli_la_SOURCES = pulsecore/cli.c pulsecore/cli.h
-libcli_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libcli_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libcli_la_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
libprotocol_cli_la_SOURCES = pulsecore/protocol-cli.c pulsecore/protocol-cli.h
-libprotocol_cli_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libprotocol_cli_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libprotocol_cli_la_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la libcli.la
libprotocol_http_la_SOURCES = pulsecore/protocol-http.c pulsecore/protocol-http.h pulsecore/mime-type.c pulsecore/mime-type.h
-libprotocol_http_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libprotocol_http_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libprotocol_http_la_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
libprotocol_native_la_SOURCES = pulsecore/protocol-native.c pulsecore/protocol-native.h pulsecore/native-common.h
libprotocol_native_la_CFLAGS = $(AM_CFLAGS) $(SERVER_CFLAGS)
-libprotocol_native_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libprotocol_native_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libprotocol_native_la_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
if HAVE_DBUS
libprotocol_native_la_CFLAGS += $(DBUS_CFLAGS)
@@ -1113,7 +1115,7 @@ endif
if HAVE_ESOUND
libprotocol_esound_la_SOURCES = pulsecore/protocol-esound.c pulsecore/protocol-esound.h pulsecore/esound.h
-libprotocol_esound_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libprotocol_esound_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libprotocol_esound_la_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
endif
@@ -1123,19 +1125,19 @@ librtp_la_SOURCES = \
modules/rtp/sap.c modules/rtp/sap.h \
modules/rtp/rtsp_client.c modules/rtp/rtsp_client.h \
modules/rtp/headerlist.c modules/rtp/headerlist.h
-librtp_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+librtp_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
librtp_la_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
libraop_la_SOURCES = \
modules/raop/raop_client.c modules/raop/raop_client.h \
modules/raop/base64.c modules/raop/base64.h
libraop_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_CFLAGS) -I$(top_srcdir)/src/modules/rtp
-libraop_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libraop_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libraop_la_LIBADD = $(AM_LIBADD) $(OPENSSL_LIBS) libpulsecore- at PA_MAJORMINOR@.la librtp.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
# Avahi
libavahi_wrap_la_SOURCES = pulsecore/avahi-wrap.c pulsecore/avahi-wrap.h
-libavahi_wrap_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
+libavahi_wrap_la_LDFLAGS = $(AM_LDFLAGS) $(AM_LIBLDFLAGS) -avoid-version
libavahi_wrap_la_CFLAGS = $(AM_CFLAGS) $(AVAHI_CFLAGS)
libavahi_wrap_la_LIBADD = $(AM_LIBADD) $(AVAHI_CFLAGS) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
More information about the pulseaudio-commits
mailing list