-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Package: usplash
Version: 0.5.19-3
Severity: normal
Tags: patch

While testing my own usplash theme, usplash was crashing when shutdown in
pulsating mode, because the SIGALRM triggered while graphics were already
shut down.

The attached simple fix sets pulsating = 0 when exiting the main_loop().

Upstream is informed via:

https://bugs.launchpad.net/ubuntu/+source/usplash/+bug/259761

Jan-Marek
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFIrCnSj6MK58wZA3cRAikQAJ0S61VRgghWZ34jQxTa0VwHwucZkgCeOoWY
ENlLx0ZqQvySTUlDrt9IrJM=
=TBG2
-----END PGP SIGNATURE-----
--- usplash/usplash.c   2008-07-07 10:31:22.000000000 +0200
+++ usplash-0.5.19/usplash.c    2008-08-20 16:12:19.000000000 +0200
@@ -157,6 +155,7 @@
 static int main_loop(void)
 {
        struct timeval tv;
+       int ret = 0;
 
        for (;;) {
                fd_set rfds;
@@ -172,24 +171,28 @@
 
                if (retval < 0 && errno != EINTR) {
                        /* Error */
-                       return 1;
+                       ret = 1;
+                       break;
                } else if (retval < 0 && errno == EINTR) {
                        /* Count cycles for timeout */
                        cycles++;
                        if (cycle_timeout && cycles >= cycle_timeout)
-                               return 0;
+                               break;
                } else if (retval > 0) {
                        /* Data available */
-                       int ret;
                        cycles = 0;
                        ret = read_command();
                        if (ret)
-                               return ret;
+                               break;
                }
        }
 
-       /* Not reached */
-       return 0;
+       /* Disable pulsating on shutdown, otherwise SIGALRM / animate_step 
+        * will likely crash usplash
+        */
+       pulsating = 0;
+
+       return ret;
 }
 
 static int read_command(void)

Reply via email to