]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsamixer: Fix X-win related crash for PulseAudio plugin (bad linking)
authorJaroslav Kysela <perex@perex.cz>
Wed, 2 Nov 2011 16:27:47 +0000 (17:27 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 12 Sep 2012 13:54:06 +0000 (15:54 +0200)
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>
alsamixer/cli.c
alsamixer/die.c
alsamixer/mainloop.c
alsamixer/mainloop.h

index 3898196e8b35cd0c60b631e2fe92ba1d94ebd037..bb4f030031d6cb38431cf6437021c5ec2b706f4d 100644 (file)
@@ -130,6 +130,6 @@ int main(int argc, char *argv[])
 
        mainloop();
 
-       shutdown();
+       app_shutdown();
        return 0;
 }
index dcd8536c04340bf5c683e1a181b7680660a08263..899a5014f8dc64260c4d78d2bbb57ac150bc31e0 100644 (file)
 
 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);
 }
index eddaf3be44f21119d80703f93e6db3702c177eca..dbfef9b3c9c6bdc28b26646408115a561f7c5549 100644 (file)
@@ -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();
index 0cfc989aa01a20ea1feffc0baa0bcd2e832828b4..22317be2ff6734b1a0bd0e30072a654b9029a839 100644 (file)
@@ -5,6 +5,6 @@
 
 void initialize_curses(bool use_color);
 void mainloop(void);
-void shutdown(void);
+void app_shutdown(void);
 
 #endif