gdm r6655 - in branches/gnome-2-20: . daemon



Author: bcameron
Date: Tue Jan  6 15:03:35 2009
New Revision: 6655
URL: http://svn.gnome.org/viewvc/gdm?rev=6655&view=rev

Log:
2009-01-06 Brian Cameron <brian cameron sun com>

        * daemon/server.c, daemon/gdm-daemon-config.c: Set default
          PRIO values appropriately.


Modified:
   branches/gnome-2-20/ChangeLog
   branches/gnome-2-20/daemon/gdm-daemon-config.c
   branches/gnome-2-20/daemon/server.c

Modified: branches/gnome-2-20/daemon/gdm-daemon-config.c
==============================================================================
--- branches/gnome-2-20/daemon/gdm-daemon-config.c	(original)
+++ branches/gnome-2-20/daemon/gdm-daemon-config.c	Tue Jan  6 15:03:35 2009
@@ -1050,14 +1050,14 @@
 	return retval;
 }
 
-/* PRIO_MIN and PRIO_MAX are not defined on Solaris, but are -20 and 20 */
 #if __sun
-#ifndef PRIO_MIN
-#define PRIO_MIN 0
-#endif
-#ifndef PRIO_MAX
-#define PRIO_MAX (NZERO*2)-1
-#endif
+#define GDM_PRIO_MIN 0
+#define GDM_PRIO_MAX (NZERO*2)-1
+#define GDM_PRIO_DEFAULT NZERO
+#else
+#define GDM_PRIO_MIN PRIO_MIN
+#define GDM_PRIO_MAX PRIO_MAX
+#define GDM_PRIO_DEFAULT 0
 #endif
 
 /**
@@ -1119,10 +1119,10 @@
 
 	/* do some bounds checking */
 	n = svr->priority;
-	if (n < PRIO_MIN)
-		n = PRIO_MIN;
-	else if (n > PRIO_MAX)
-		n = PRIO_MAX;
+	if (n < GDM_PRIO_MIN)
+		n = GDM_PRIO_MIN;
+	else if (n > GDM_PRIO_MAX)
+		n = GDM_PRIO_MAX;
 
 	if (n != svr->priority) {
 		gdm_error (_("%s: Priority out of bounds; changed to %d"),
@@ -1173,7 +1173,7 @@
 		svr->flexible  = TRUE;
 		svr->choosable = TRUE;
 		svr->handled   = TRUE;
-		svr->priority  = 0;
+		svr->priority  = GDM_PRIO_DEFAULT;
 
 		xservers       = g_slist_append (xservers, svr);
 	}

Modified: branches/gnome-2-20/daemon/server.c
==============================================================================
--- branches/gnome-2-20/daemon/server.c	(original)
+++ branches/gnome-2-20/daemon/server.c	Tue Jan  6 15:03:35 2009
@@ -57,6 +57,12 @@
 
 #include "gdm-socket-protocol.h"
 
+#if __sun
+#define GDM_PRIO_DEFAULT NZERO
+#else
+#define GDM_PRIO_DEFAULT 0
+#endif
+
 /* Local prototypes */
 static void gdm_server_spawn (GdmDisplay *d, const char *vtarg);
 static void gdm_server_usr1_handler (gint);
@@ -1042,7 +1048,7 @@
 		disp->handled = FALSE;
 		/* never ever ever use chooser here */
 		disp->use_chooser = FALSE;
-		disp->priority = 0;
+		disp->priority = GDM_PRIO_DEFAULT;
 		/* run just one session */
 		argv[len++] = g_strdup ("-terminate");
 		argv[len++] = g_strdup ("-query");
@@ -1263,7 +1269,7 @@
 
 	gdm_debug ("gdm_server_spawn: '%s'", command);
 	
-	if (d->priority != 0) {
+	if (d->priority != GDM_PRIO_DEFAULT) {
 		if (setpriority (PRIO_PROCESS, 0, d->priority)) {
 			gdm_error (_("%s: Server priority couldn't be set to %d: %s"),
 				   "gdm_server_spawn", d->priority,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]