20788N/Acommit c7791f293660c22fd699020ff1ec1ac83ad94afa
20788N/AAuthor: Halton Huo <halton.huo@sun.com>
20788N/ADate: Fri Nov 27 21:30:58 2009 +0800
20788N/A AC_DEFINE_UNQUOTED(XEVIE_OPTION,"$XEVIE_OPTION",[Define xevie option])
20788N/A+# Check for Solaris VT and fbconsole support
20788N/A+if test x$FBCONSOLE != xno ; then
20788N/A+ AC_DEFINE_UNQUOTED([FBCONSOLE], "$FBCONSOLE", [fbconsole program])
20788N/A dnl ---------------------------------------------------------------------------
20788N/A dnl - Check for audit framework
20788N/A dnl ---------------------------------------------------------------------------
20788N/A@@ -69,6 +75,7 @@ struct GdmServerPrivate
20788N/A@@ -120,6 +127,128 @@ static void gdm_server_finalize (GObject *object);
20788N/A G_DEFINE_TYPE (GdmServer, gdm_server, G_TYPE_OBJECT)
20788N/A+gdm_exec_fbconsole (GdmServer *server)
20788N/A+ if (server->priv->fbconsolepid == 0) {
20788N/A+ g_debug ("Checking if fbconsole should be started");
20788N/A+ g_debug ("Running on console");
20788N/A+ /* If no VT, then run fbconsole */
20788N/A+ /* Set run_fbconsole as TRUE since Xsun
20788N/A+ res = g_spawn_command_line_sync (command,
20788N/A+ arr = g_strsplit (out,"\n", -1);
20788N/A+ arr1 = g_strsplit (arr[i], " ", -1);
20788N/A+ x_server = g_strdup (arr1[2]);
20788N/A+ if (g_str_has_suffix (x_server, "Xsun")) {
20788N/A+ if (ioctl (fd, VT_ENABLED, &vtstat) == 0) {
20788N/A+ g_debug ("VT is enabled, so not forking fbconsole");
20788N/A+ g_debug ("VT is not enabled, so fork fbconsole");
20788N/A+ g_debug ("Using %s and not on console, so not forking fbconsole",
20788N/A+ server->priv->display_device ? server->priv->display_device : "(null)");
20788N/A+ argv[3] = server->priv->display_name;
20788N/A+ g_debug ("Forking fbconsole");
20788N/A+ server->priv->fbconsolepid = fork ();
20788N/A+ if (server->priv->fbconsolepid == 0) {
20788N/A+ g_debug ("Can not start fallback console: %s",
20788N/A+ if (server->priv->fbconsolepid == -1) {
20788N/A+ g_debug ("Can not start fallback console");
20788N/A _gdm_server_query_ck_for_display_device (GdmServer *server)
20788N/A@@ -165,6 +294,10 @@ gdm_server_get_display_device (GdmServer *server)
20788N/A g_object_notify (G_OBJECT (server), "display-device");
20788N/A return g_strdup (server->priv->display_device);
20788N/A@@ -733,6 +866,15 @@ gdm_server_stop (GdmServer *server)
20788N/A+ /* Kill fbconsole if it is running */
20788N/A+ if (server->priv->fbconsolepid > 0) {
20788N/A+ g_debug ("Killing fbconsole");
20788N/A+ kill (server->priv->fbconsolepid, SIGTERM);
20788N/A+ server->priv->fbconsolepid = 0;
20788N/A@@ -933,6 +1075,7 @@ gdm_server_init (GdmServer *server)
20788N/A server->priv->log_dir = g_strdup (LOGDIR);
20788N/A+ server->priv->fbconsolepid = 0;