[Splashy-devel] Bug#505270: Bug#505270: my patch (a fast way to deal with this bug)

Matthijs Kooijman matthijs at stdin.nl
Tue Jan 6 09:09:48 UTC 2009


Hi Time,

> As indicated already, please consider this patch for the next version of
> splashy. It replaces the sleep in the script, and only holds up init for
> the time necessary (certainly less than 0.5 s and perhaps only 0.1 s)
> (attached)
Turns out the patch was easier than I expected :-)

>  
> +        /* register signal handlers if we are doing splashy boot */
> +          if (g_ascii_strncasecmp (argv[1], "boot", 4) == 0) {
> +                 (void) signal (SIGCHLD, sig_exit_boot);   /* this signal is sent when a child process exits */
> +                 (void) signal (SIGUSR2, sig_exit_boot);   /* this is the signal sent by _splashy_child indicating directfb is fully initialised */
> +                                                                                     /* so the parent process can exit, letting init continue. We lock initramfs from */
> +                                                                                      /* being unmounted while the child process is still setting up directfb. */
> +                                                                                     /* some machines had a race condition causing splashy failure */
> +                                                                                     /* This fixes bug 505270 */
> +        }
> +        
You're messing up the indentation here, presumably because your not mixing
tabs and spaces properly (though I don't see any real tabs in the patch..)

> @@ -141,6 +177,8 @@
>                  {
>                          DEBUG_PRINT ("Calling splashy_child_start()");
>                          splashy_child_start ();
> +                    
> +                        
>                  }
>                  else if (g_ascii_strncasecmp (argv[1], "shutdown", 8) == 0)
>                  {
This is a pretty useless hunk :-)

> +            /*      Wait 1s for signal. There are two possible signals.  */
> +            /*      The child may die (splashy failed), or the child process signals that directfb is setup. */        
> +             /*     If the exit signal does not come in this time, then exit anyway */
> +            /*      the signal should come very quickly, so this approach saves most of a second */
> +                    
> +                    g_usleep(1000000); /* 1s */
> +                    g_printerr ("%s", "Error occured : splashy boot terminated; timed out waiting for splashy to initialise\n");
> +          } 

Perhaps it would be good to increase this sleep interval? On normal operation,
the time isn't reached anyway, and on slow computers / boot media it could
perhaps take long time. It would be annoying if this bug would be reintroduced
just because a particular machine or boot takes a bit longer. How about making
it 10s?

Also, I would write this as:
	g_usleep(10*1000*1000)
It's a bit clearer IMHO.

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/splashy-devel/attachments/20090106/a6698b7c/attachment-0001.pgp 


More information about the Splashy-devel mailing list