rpms/rhgb/devel rhgb-0.16.4-random-fixups.patch, 1.1, 1.2 rhgb.spec, 1.59, 1.60

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Oct 26 03:41:00 UTC 2006


Author: rstrode

Update of /cvs/dist/rpms/rhgb/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv16914

Modified Files:
	rhgb-0.16.4-random-fixups.patch rhgb.spec 
Log Message:
- kill rhgb before gdm starts to prevent weird vt switching
  behavior (bug 211848)


rhgb-0.16.4-random-fixups.patch:
 main.c   |  194 ++++++++++++++++++++++++---------------------------------------
 splash.c |   49 ++++++++-------
 splash.h |    4 -
 3 files changed, 103 insertions(+), 144 deletions(-)

Index: rhgb-0.16.4-random-fixups.patch
===================================================================
RCS file: /cvs/dist/rpms/rhgb/devel/rhgb-0.16.4-random-fixups.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- rhgb-0.16.4-random-fixups.patch	18 Oct 2006 15:33:52 -0000	1.1
+++ rhgb-0.16.4-random-fixups.patch	26 Oct 2006 03:40:58 -0000	1.2
@@ -1,5 +1,5 @@
 --- rhgb-0.16.4/src/splash.h.random-fixups	2004-09-14 18:01:49.000000000 -0400
-+++ rhgb-0.16.4/src/splash.h	2006-10-18 06:35:46.000000000 -0400
++++ rhgb-0.16.4/src/splash.h	2006-10-24 12:02:28.000000000 -0400
 @@ -82,5 +82,7 @@
  			     const gchar *string,
  			     glong length);
@@ -9,8 +9,8 @@
 +int get_active_vt (void);
 +
  #endif /* __SPLASH_H__ */
---- rhgb-0.16.4/src/splash.c.random-fixups	2006-10-18 06:35:46.000000000 -0400
-+++ rhgb-0.16.4/src/splash.c	2006-10-18 06:35:46.000000000 -0400
+--- rhgb-0.16.4/src/splash.c.random-fixups	2006-10-24 12:02:28.000000000 -0400
++++ rhgb-0.16.4/src/splash.c	2006-10-24 12:02:28.000000000 -0400
 @@ -22,10 +22,12 @@
  #include "splash.h"
  
@@ -85,7 +85,7 @@
  static void
  event_box_realize (GtkWidget *event_box,
  		   gpointer data ATTRIBUTE_UNUSED)
-@@ -302,10 +303,12 @@
+@@ -301,10 +302,12 @@
  		    "show",
  		    (GCallback) window_show,
  		    splash);
@@ -98,8 +98,8 @@
    g_signal_connect (G_OBJECT (splash->window),
  		    "key-press-event",
  		    (GCallback) key_pressed_event,
---- rhgb-0.16.4/src/main.c.random-fixups	2006-10-18 06:35:45.000000000 -0400
-+++ rhgb-0.16.4/src/main.c	2006-10-18 06:44:42.000000000 -0400
+--- rhgb-0.16.4/src/main.c.random-fixups	2006-10-24 12:02:28.000000000 -0400
++++ rhgb-0.16.4/src/main.c	2006-10-25 16:37:28.000000000 -0400
 @@ -54,7 +54,6 @@
  #define VT_NAME "/dev/tty8"
  #define X_COMMAND1 "/usr/bin/Xorg -s off -dpms -v -nolock -fp /usr/share/X11/fonts/misc -logfile " XLOGFILE " " X_NO_DRI " " DISPLAY_NO " vt8"
@@ -131,22 +131,31 @@
  static gint pipe_fd = -1;
 -static gint quit_timeout = 0;
 -static gint x_timeout = 0;
-+static sig_atomic_t quit_timeout = 0, display_is_ready = FALSE;
++static sig_atomic_t display_is_ready = FALSE;
 +static gint display_ready_fds[2] = { -1, -1 };
 +
 +static gint exit_code = 0;
  
  static const char *system_service_names[] =
  {
-@@ -175,7 +168,6 @@
+@@ -175,38 +168,17 @@
    g_free (full_message);
  }
  
 -
+-/*
+- * Test if the main graphical screen started
+- * Returns TRUE if started and FALSE otherwise
+- */
+-static gboolean
+-test_graphical(void) {
+-    struct stat buf;
+-
+-    return (stat("/tmp/.X0-lock", &buf) == 0);
+-}
+-
  /*
-  * Test if the main graphical screen started
-  * Returns TRUE if started and FALSE otherwise
-@@ -192,21 +184,12 @@
+  * The shutdown function. Kill the specific X process, and umount
   * the special filesystem
   */
  static void
@@ -170,7 +179,7 @@
      if (socket_fd >= 0) {
  	close(socket_fd);
  	socket_fd = -1;
-@@ -222,7 +205,6 @@
+@@ -222,7 +194,6 @@
      unlink(DEBUGFILE);
      unmount_ramfs();
      system(FIX_INIT_COMMAND);
@@ -178,7 +187,7 @@
  }
  
  /*
-@@ -231,7 +213,7 @@
+@@ -231,7 +202,7 @@
  static void
  got_signal(int no ATTRIBUTE_UNUSED) {
      if (child_pid > 0) {
@@ -187,7 +196,7 @@
      }
      if (socket_fd >= 0) {
  	close(socket_fd);
-@@ -271,10 +253,12 @@
+@@ -271,10 +242,12 @@
   */
  static gboolean manual_switch = 0;
  
@@ -202,7 +211,7 @@
  	switched_vt1 = 0;
      }
      if (!from_pipe && connection_timeout >= 0)
-@@ -287,7 +271,8 @@
+@@ -287,7 +260,8 @@
  }
  
  static gboolean
@@ -212,7 +221,7 @@
      if(connection_timeout >= 0) connection_timeout++;
      pipe_timeout++;
      /*
-@@ -304,27 +289,14 @@
+@@ -304,29 +278,6 @@
  	switched_details = 1;
      }
  
@@ -228,23 +237,21 @@
 -	    rhgb_shutdown(-1, 7);
 -	}
 -    }
-     if (quit_timeout > 0) {
-         quit_timeout--;
- 	connection_timeout = 0;
- 	if (quit_timeout == 0) {
+-    if (quit_timeout > 0) {
+-        quit_timeout--;
+-	connection_timeout = 0;
+-	if (quit_timeout == 0) {
 -	    switch_to_vt(7);
 -	    rhgb_shutdown(-1, 7);
 -	} else if (test_graphical()) {
 -	    quit_timeout = 0;
 -	    x_timeout = X_TIMEOUT;
-+	    exit_code = 1;
-+	    gtk_main_quit ();
-+	} else if (test_graphical ()) {
-+	    gtk_main_quit ();
- 	}
-     }
+-	}
+-    }
      return (TRUE);
-@@ -512,7 +484,9 @@
+ }
+ 
+@@ -512,7 +463,9 @@
    unlink(DISPLAY_FNAME);
    unlink(PIPE_NAME);
    unmount_ramfs();
@@ -255,7 +262,7 @@
  }
  
  static gboolean
-@@ -564,13 +538,28 @@
+@@ -564,13 +517,28 @@
    return console_initialized;
  }
  
@@ -285,7 +292,7 @@
    int fd;
  
    if (use_existing_server != NULL)
-@@ -579,7 +568,7 @@
+@@ -579,7 +547,7 @@
  
        env = g_strdup_printf ("DISPLAY=%s", use_existing_server);
        putenv (env);
@@ -294,7 +301,7 @@
      }
  
    system (NETWORK_COMMAND);
-@@ -603,49 +592,44 @@
+@@ -603,49 +571,44 @@
     */
    virtual_console_init ();
  
@@ -314,18 +321,14 @@
  
 -  return 0;
 -}
--
++  fcntl (display_ready_fds[0], F_SETFD, FD_CLOEXEC);
++  fcntl (display_ready_fds[1], F_SETFD, FD_CLOEXEC); 
+ 
 -static gboolean
 -display_init_failsafe (void)
 -{
 -  gchar **argv;
 -  int fd;
-+  fcntl (display_ready_fds[0], F_SETFD, FD_CLOEXEC);
-+  fcntl (display_ready_fds[1], F_SETFD, FD_CLOEXEC); 
- 
--  if (use_existing_server != NULL)
--    {
--      gchar *env;
 +  channel = g_io_channel_unix_new (display_ready_fds[0]);
 +  g_io_add_watch (channel, 
 +		  G_IO_HUP | G_IO_ERR,
@@ -337,11 +340,19 @@
 +		 (GSpawnChildSetupFunc) child_setup, NULL, &child_pid, NULL);
 +  g_child_watch_add (child_pid, (GChildWatchFunc) gtk_main_quit, NULL);
  
+-  if (use_existing_server != NULL)
+-    {
+-      gchar *env;
++  gtk_main ();
+ 
 -      env = g_strdup_printf ("DISPLAY=%s", use_existing_server);
 -      putenv (env);
 -      return 0;
 -    }
-+  gtk_main ();
++  if (display_ready_fds[0] >= 0)
++	  close (display_ready_fds[0]);
++  if (display_ready_fds[1] >= 0)
++	  close (display_ready_fds[1]);
  
 -  unsetenv ("XAUTHORITY");
 -  putenv ((char *) DISPLAY_ENV);
@@ -349,11 +360,7 @@
 -  g_shell_parse_argv (X_FAILSAFE,
 -		      NULL, &argv,
 -		      NULL);
-+  if (display_ready_fds[0] >= 0)
-+	  close (display_ready_fds[0]);
-+  if (display_ready_fds[1] >= 0)
-+	  close (display_ready_fds[1]);
- 
+-
 -  g_spawn_async ("/", argv, NULL,
 -		 0, NULL, NULL, &child_pid, NULL);
    g_strfreev (argv);
@@ -370,7 +377,7 @@
  }
  
  static gboolean
-@@ -765,13 +749,12 @@
+@@ -765,13 +728,8 @@
  
    if (! strcmp (command, "quit"))
      {
@@ -378,17 +385,15 @@
 -          rhgb_shutdown(return_fd, 0);
 -      }
 -      else if (quit_timeout == 0) {
-+      if (test_graphical ()) {
-+	  gtk_main_quit ();
-+      } else if (quit_timeout == 0) {
-           quit_timeout = QUIT_TIMEOUT;
-       }
+-          quit_timeout = QUIT_TIMEOUT;
+-      }
 -      write(return_fd, "done", strlen("done") + 1);
++      gtk_main_quit ();
 +      write (return_fd, "done", strlen("done") + 1);
        update_progress_bar("loginscreen");
      }
    else if (! strcmp (command, "ping"))
-@@ -821,7 +804,7 @@
+@@ -821,7 +779,7 @@
    switch (status)
      {
      case G_IO_STATUS_NORMAL:
@@ -397,7 +402,7 @@
        if (bytes_read >= 200)
  	{
  	  DEBUG_MESSAGE ("More than 200 bytes: %d\n", bytes_read);
-@@ -934,7 +917,7 @@
+@@ -934,7 +892,7 @@
  
          switch (status) {
              case G_IO_STATUS_NORMAL:
@@ -406,7 +411,7 @@
                  if (bytes_read > 4096) {
                      DEBUG_MESSAGE("More than 4096 bytes: %d\n", bytes_read);
                      goto done;
-@@ -1090,7 +1073,6 @@
+@@ -1090,7 +1048,6 @@
    close (close_parent_fd);
  }
  
@@ -414,7 +419,7 @@
  int
  main (int argc, char *argv[])
  {
-@@ -1186,8 +1168,8 @@
+@@ -1186,8 +1143,8 @@
    signal(SIGSEGV, got_signal);
  
    DEBUG_MESSAGE("Initializing display\n");
@@ -425,26 +430,26 @@
  
    DEBUG_MESSAGE("Initializing socket\n");
    if (socket_init () != 0)
-@@ -1197,16 +1179,9 @@
+@@ -1197,16 +1154,9 @@
      setup_failed ();
  
    DEBUG_MESSAGE("Checking gtk\n");
 -  if (gtk_init_check (&argc, &argv) == 0) {
 -      DEBUG_MESSAGE("Trying failsafe display\n");
 -      if (display_init_failsafe () != 0)
--	  setup_failed ();
++  if (gtk_init_check (&argc, &argv) == 0)
+ 	  setup_failed ();
 -
 -      DEBUG_MESSAGE("Checking gtk again\n");
 -      if (gtk_init_check (&argc, &argv) == 0) {
-+  if (gtk_init_check (&argc, &argv) == 0)
- 	  setup_failed ();
+-	  setup_failed ();
 -      }
 -  }
 + 
    DEBUG_MESSAGE("Checking gtk okay\n");
  
    if (check_for_xrdb())
-@@ -1224,10 +1199,14 @@
+@@ -1224,10 +1174,14 @@
    init_timeout();
  
    DEBUG_MESSAGE("Running GTK main loop\n");


Index: rhgb.spec
===================================================================
RCS file: /cvs/dist/rpms/rhgb/devel/rhgb.spec,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- rhgb.spec	18 Oct 2006 15:33:52 -0000	1.59
+++ rhgb.spec	26 Oct 2006 03:40:58 -0000	1.60
@@ -3,7 +3,7 @@
 Summary: Red Hat Graphical Boot
 Name: rhgb
 Version: 0.16.4
-Release: 2%{?dist}
+Release: 3%{?dist}
 URL: http://www.redhat.com/
 Source0: %{name}-%{version}.tar.gz
 License: GPL
@@ -73,6 +73,10 @@
 %dir %{_sysconfdir}/rhgb/temp
 
 %changelog
+* Wed Oct 25 2006 Ray Strode <rstrode at redhat.com> - 0.16.4-3
+- kill rhgb before gdm starts to prevent weird vt switching
+  behavior (bug 211848)
+
 * Wed Oct 18 2006 Ray Strode <rstrode at redhat.com> - 0.16.4-2
 - don't execute interactive bash shell during setup (bug 209457)
 - drop the change vts code in the exit path, Adam Jackson says 




More information about the fedora-cvs-commits mailing list