blob: f923cd92a5b98d9b546ae4ee0ea2f1a56e90fb5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
Index: dga.c
===================================================================
RCS file: /cvs/xorg/app/xf86dga/dga.c,v
retrieving revision 1.2
diff -u -r1.2 dga.c
--- dga.c 23 Apr 2004 19:54:47 -0000 1.2
+++ dga.c 19 Jun 2006 21:31:33 -0000
@@ -16,6 +16,7 @@
#include <X11/Xmd.h>
#include <X11/extensions/xf86dga.h>
#include <ctype.h>
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
@@ -141,7 +142,10 @@
#ifndef __UNIXOS2__
/* Give up root privs */
- setuid(getuid());
+ if (setuid(getuid()) == -1) {
+ fprintf(stderr, "Unable to change uid: %s\n", strerror(errno));
+ exit(2);
+ }
#endif
XF86DGASetViewPort(dis, DefaultScreen(dis), 0, 0);
|