aboutsummaryrefslogtreecommitdiffstats
path: root/src/firemon/x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firemon/x11.c')
-rw-r--r--src/firemon/x11.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/firemon/x11.c b/src/firemon/x11.c
deleted file mode 100644
index 09eb3cd06..000000000
--- a/src/firemon/x11.c
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * Copyright (C) 2014-2018 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "firemon.h"
21#include <sys/types.h>
22#include <sys/stat.h>
23#include <unistd.h>
24
25void x11(pid_t pid, int print_procs) {
26 pid_read(pid);
27
28 // print processes
29 int i;
30 for (i = 0; i < max_pids; i++) {
31 if (pids[i].level == 1) {
32 if (print_procs || pid == 0)
33 pid_print_list(i, arg_nowrap);
34
35 char *x11file;
36 // todo: use macro from src/firejail/firejail.h for /run/firejail/x11 directory
37 if (asprintf(&x11file, "/run/firejail/x11/%d", i) == -1)
38 errExit("asprintf");
39
40 FILE *fp = fopen(x11file, "r");
41 if (!fp) {
42 free(x11file);
43 continue;
44 }
45
46 int display;
47 int rv = fscanf(fp, "%d", &display);
48 if (rv == 1)
49 printf(" DISPLAY :%d\n", display);
50 fclose(fp);
51 free(x11file);
52 }
53 }
54 printf("\n");
55}