summaryrefslogtreecommitdiff
path: root/xload.c
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2015-04-21 13:10:48 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2015-05-07 19:57:38 +0100
commit57e2f649e76cba9e9959ca072ba10285cd17a060 (patch)
tree88e250c4b10ef0cd79ab87e9affa099ea197682a /xload.c
parent3d5d39cc98b4c5cbecbc1f10db1f6c01963efa94 (diff)
Don't try to use [gs]et[ug]id on Win32
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: David Macek <david.macek.0@gmail.com>
Diffstat (limited to 'xload.c')
-rw-r--r--xload.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xload.c b/xload.c
index 32adcdd..4c07102 100644
--- a/xload.c
+++ b/xload.c
@@ -178,6 +178,8 @@ main(int argc, char **argv)
/* For security reasons, we reset our uid/gid after doing the necessary
system initialization and before calling any X routines. */
InitLoadPoint();
+
+#if !defined(_WIN32) || defined(__CYGWIN__)
/* reset gid first while still (maybe) root */
if (setgid(getgid()) == -1) {
fprintf(stderr, gettext("%s: setgid failed: %s\n"),
@@ -189,6 +191,7 @@ main(int argc, char **argv)
ProgramName, strerror(errno));
exit(1);
}
+#endif
XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);