summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <bcameron@src.gnome.org>2007-04-09 05:07:27 +0000
committerBrian Cameron <bcameron@src.gnome.org>2007-04-09 05:07:27 +0000
commit11ced0a536d0d2742dc0aa8e528f77ec668e041d (patch)
tree2154f97eca9cfcb48a21fa0628a2c887b4bf6295
parent6a572072e69ca1adfe235fce600b5b3d471a54ec (diff)
downloadgdm-GDM2_2_18_1.tar.gz
Better fix for gdmflexiserver.c.GDM2_2_18_1
svn path=/branches/gnome-2-18/; revision=4796
-rw-r--r--daemon/gdm.h2
-rw-r--r--gui/gdmflexiserver.c55
2 files changed, 34 insertions, 23 deletions
diff --git a/daemon/gdm.h b/daemon/gdm.h
index 1e9b2d15..32603be1 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 b652bb8a..176551a1 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 */