summaryrefslogtreecommitdiff
path: root/dga.c
diff options
context:
space:
mode:
Diffstat (limited to 'dga.c')
-rw-r--r--dga.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dga.c b/dga.c
index e2a7ce4..7305ecd 100644
--- a/dga.c
+++ b/dga.c
@@ -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 @@ main(int argc, char *argv[])
#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);