From 11ced0a536d0d2742dc0aa8e528f77ec668e041d Mon Sep 17 00:00:00 2001 From: Brian Cameron Date: Apr 09 2007 05:07:27 +0000 Subject: Better fix for gdmflexiserver.c. svn path=/branches/gnome-2-18/; revision=4796 --- diff --git a/daemon/gdm.h b/daemon/gdm.h index 1e9b2d1..32603be 100644 --- a/daemon/gdm.h +++ b/daemon/gdm.h @@ -223,7 +223,7 @@ enum { #define GDM_KEY_KILL_INIT_CLIENTS "daemon/KillInitClients=true" #define GDM_KEY_LOG_DIR "daemon/LogDir=" LOGDIR #define GDM_KEY_PATH "daemon/DefaultPath=" GDM_USER_PATH -#define GDM_KEY_PID_FILE "daemon/PidFile=/var/run/gdm.pid" +#define GDM_KEY_PID_FILE "daemon/PidFile=" GDM_PID_FILE #define GDM_KEY_POSTSESSION "daemon/PostSessionScriptDir=" GDMCONFDIR "/PostSession/" #define GDM_KEY_PRESESSION "daemon/PreSessionScriptDir=" GDMCONFDIR "/PreSession/" #define GDM_KEY_POSTLOGIN "daemon/PostLoginScriptDir=" GDMCONFDIR "/PreSession/" diff --git a/gui/gdmflexiserver.c b/gui/gdmflexiserver.c index b652bb8..176551a 100644 --- a/gui/gdmflexiserver.c +++ b/gui/gdmflexiserver.c @@ -727,12 +727,26 @@ main (int argc, char *argv[]) if (args_remaining != NULL && args_remaining[0] != NULL) server = args_remaining[0]; - if ( ! gdmcomm_check (FALSE)) { - gdm_common_error ("Error: GDM (GNOME Display Manager) is not " - "running."); - gdm_common_error ("You might be using a different display " - "manager."); - return 1; + if (send_command != NULL) { + if ( ! gdmcomm_check (FALSE)) { + gdm_common_error ("Error: GDM (GNOME Display Manager) " + "is not running."); + gdm_common_error ("You might be using a different " + "display manager."); + return 1; + } + } else { + /* + * The --command argument does not display anything, so avoid + * running gtk_init until it finishes. Sometimes the + * --command argument is used when there is no display so it + * will fail and cause the program to exit, complaining about + * "no display". + */ + gtk_init(&argc, &argv); + if ( ! gdmcomm_check (TRUE)) { + return 1; + } } /* Start reading config data in bulk */ @@ -800,25 +814,22 @@ main (int argc, char *argv[]) } /* - * The --command argument does not display anything, so avoid running - * gtk_init until it finishes. Sometimes the --command argument is - * used when there is no display so it will fail and cause the - * program to exit, complaining about "no display". + * Now process what gdmflexiserver is more frequently used to + * do, start VT (Virtual Terminal) sesions - at least on + * systems where it is supported. On systems where it is not + * supporteed VT stands for "Very Tight" and will mess up your + * display if you use it. Tight! So do not use it. * - * Now process what gdmflexiserver is more used to do, start a - * VT virtual terminal sesions - at least on systems where it - * works. On systems where it doesn't work VT stands for - * "Very Tight" and will mess up your display if you try to - * use it. Tight! So don't use it. I'd accept a patch to - * disable it, but its easy to avoid not using it as long - * as your distro doesn't put the menu choice in the - * application launch button on the panel (don't ship the - * desktop file). + * I would accept a patch to disable it on such systems, but it + * is easy to avoid not using it as long as your distro does not + * put the menu choice in the application launch button on the + * panel (don't ship the desktop file). */ - gtk_init(&argc, &argv); - /* always attempt to get cookie and authenticate. On remote - servers */ + /* + * Always attempt to get cookie and authenticate. On remote + * servers + */ auth_cookie = gdmcomm_get_auth_cookie (); /* check for other displays/logged in users */