summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2011-11-02 17:27:47 +0100
committerJaroslav Kysela <perex@perex.cz>2011-11-02 17:27:47 +0100
commit4c09aaa5c13c2260fea57a89c47f88252da8a692 (patch)
tree0d96fd01e1fa9cd7c9a69497b3dd6f21c8546076
parentaf0bf78505be9473c7ce276f91942a5d8f1ad41c (diff)
downloadalsa-utils-4c09aaa5c13c2260fea57a89c47f88252da8a692.tar.gz
alsamixer: Fix X-win related crash for PulseAudio plugin (bad linking)
A lot of reports that alsamixer crashes in X terminal when the PulseAudio CTL plugin is activated were entered to the tracking systems. I figured that there is a linking clash for the shutdown() function. The shutdown() function in glibc is socket related, but the alsamixer code redefines this function and appearently that under some linking circumstances - which PA client invokes during the runtime dynamic linking - the wrong function is called. This patch, for safety, renames the shutdown() function from alsamixer to app_shutdown(), but it might make sense to figure the real linking culprit to avoid future surprises. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--alsamixer/cli.c2
-rw-r--r--alsamixer/die.c4
-rw-r--r--alsamixer/mainloop.c2
-rw-r--r--alsamixer/mainloop.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/alsamixer/cli.c b/alsamixer/cli.c
index 3898196..bb4f030 100644
--- a/alsamixer/cli.c
+++ b/alsamixer/cli.c
@@ -130,6 +130,6 @@ int main(int argc, char *argv[])
mainloop();
- shutdown();
+ app_shutdown();
return 0;
}
diff --git a/alsamixer/die.c b/alsamixer/die.c
index dcd8536..899a501 100644
--- a/alsamixer/die.c
+++ b/alsamixer/die.c
@@ -26,14 +26,14 @@
void fatal_error(const char *msg)
{
- shutdown();
+ app_shutdown();
fprintf(stderr, "%s\n", msg);
exit(EXIT_FAILURE);
}
void fatal_alsa_error(const char *msg, int err)
{
- shutdown();
+ app_shutdown();
fprintf(stderr, _("%s: %s\n"), msg, snd_strerror(err));
exit(EXIT_FAILURE);
}
diff --git a/alsamixer/mainloop.c b/alsamixer/mainloop.c
index eddaf3b..dbfef9b 100644
--- a/alsamixer/mainloop.c
+++ b/alsamixer/mainloop.c
@@ -52,7 +52,7 @@ void initialize_curses(bool use_color)
snd_lib_error_set_handler(black_hole_error_handler);
}
-void shutdown(void)
+void app_shutdown(void)
{
if (curses_initialized) {
clear();
diff --git a/alsamixer/mainloop.h b/alsamixer/mainloop.h
index 0cfc989..22317be 100644
--- a/alsamixer/mainloop.h
+++ b/alsamixer/mainloop.h
@@ -5,6 +5,6 @@
void initialize_curses(bool use_color);
void mainloop(void);
-void shutdown(void);
+void app_shutdown(void);
#endif