Package: bogl-bterm
Version: 0.1.18-1.1
Tags: patch

I found this patch in the ubuntu version of usplash, and discovered
that it is missing in the debian version.  It is also introduced in
the ubuntu version of bogl with this changelog entry:

bogl (0.1.18-1.1ubuntu3) breezy; urgency=low

  * Fix build with new dpkg-architecture
  * Add a SIGTERM signal handler which allows for a graceful exit, restoring
    the vt state

 -- Matt Zimmerman <[EMAIL PROTECTED]>  Wed,  7 Sep 2005 15:59:03 -0700

The patch make sense to me, so I thought it best to submit it to bts.
I also include the patch to make sure main() return will a known exit
value.

diff -ur usplash-0.3-4/bogl/bterm.c bogl-0.1.18/bterm.c
--- usplash-0.3-4/bogl/bterm.c  2006-06-20 12:11:13.000000000 +0200
+++ bogl-0.1.18/bterm.c 2004-07-22 12:39:42.000000000 +0200
@@ -64,7 +64,6 @@

 static int child_pid = 0;
 static struct termios ttysave;
-static int quit = 0;

 /* This first tries the modern Unix98 way of getting a pty, followed by the
  * old-fashioned BSD way in case that fails. */
@@ -140,11 +139,6 @@
   signal(SIGCHLD, sigchld);
 }

-void sigterm(int sig)
-{
-       quit = 1;
-}
-
 void spawn_shell(int ptyfd, int ttyfd, const char *command)
 {
   fflush(stdout);
@@ -294,7 +288,6 @@
   spawn_shell(ptyfd, ttyfd, command == NULL ? "/bin/sh" : command);

   signal(SIGHUP, reload_font);
-  signal(SIGTERM, sigterm);

   ntio = ttysave;
   ntio.c_lflag &= ~(ECHO|ISIG|ICANON|XCASE);
@@ -311,9 +304,6 @@
   for (;;) {
     fd_set fds;
     int max = 0;
-
-    if (quit)
-           break;

     if(pending)
     {
@@ -331,10 +321,6 @@
     if (ptyfd > max)
       max = ptyfd;
     ret = select(max+1, &fds, NULL, NULL, &tv);
-
-    if (quit)
-           break;
-
     if (bogl_refresh) {
       /* Handle VT switching.  */
       if (bogl_refresh == 2)
@@ -374,6 +360,4 @@
       }
     }
   }
-
-  return 0;
 }


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to