summaryrefslogtreecommitdiffstats
path: root/tools/xhost+.c
blob: 58781274eff5ad5cd4d088934731abdd94b7c623 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <stdlib.h>
#include <X11/Xlib.h>


int main(int argc, char **argv) {
  Display *d = XOpenDisplay(getenv("DISPLAY") ? getenv("DISPLAY") : ":0");
  if (d == NULL) exit(1);
  XDisableAccessControl(d);
  XCloseDisplay(d);
  exit(0);
}