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

Bug#179156: xserver-common: Xwrapper incorrectly reports nice values.



Package: xserver-common
Version: 4.1.0-16
Severity: minor
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

this fixes a minor cosmetic bug: the xserver reports "process set to
nice value 0 instead of XXX" when in fact the server *was* set to the
correct values.  This happens because "nice" in linux does not return
the nice value set, but instead returns 0.

- -- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux heron 2.4.18-lsm #1 Sun Jan 19 10:50:03 PST 2003 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages xserver-common depends on:
ii  debconf                       1.0.32     Debian configuration management sy
ii  libc6                         2.2.5-11.2 GNU C Library: Shared libraries an
ii  xfree86-common                4.1.0-16   X Window System (XFree86) infrastr

- --------patch is below this line--------------------------
- --- xserver-wrapper.c	Thu Jan 30 23:02:32 2003
+++ xserver-wrapper.c.new	Thu Jan 30 23:10:07 2003
@@ -53,6 +53,8 @@
  *                   specify "-help" option to get a usage message (26 Dec 2001)
  * Branden Robinson: change nice() usage to fit SuSv2 semantics; see Debian Bug
  *                   #140012
+ * Evan Buswell:     use getpriority to get nice value; return value of "nice"
+ *		     is 0 on success.
  *
  * This is free software; you may redistribute it and/or modify
  * it under the terms of the GNU General Public License as
@@ -83,6 +85,8 @@
 #include <unistd.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
 
 #define VT_MAJOR_DEV 4
 #define X_WRAPPER_CONFIG_FILE "/etc/X11/Xwrapper.config"
@@ -276,8 +281,9 @@
     seteuid(0);
     /* DEBUG fprintf(stderr, "X: attempting nice() with real uid = %d; euid = %d\n", getuid(), geteuid()); */
     errno = 0;
- -    intval = nice(niceval);
+    nice(niceval);
     if (errno) perror("X: warning; nice() of process failed");
+    intval = getpriority(PRIO_PROCESS, 0);
     if (intval != niceval) (void) fprintf(stderr, "warning: process set to nice "
         "value %d instead of %d as requested\n", intval, niceval);
     /* DEBUG exit(0); */

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+OiU/YHF64J1lpdoRAhFyAKCnktMTDqTI5Mn+HerYSy4CwuLfgwCcCQex
sOi1TRX5a73ElQj/1YUOmzA=
=9ozg
-----END PGP SIGNATURE-----




Reply to: