From ec7ae0bf40dd2c27cb2daff2d77381e0867350ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amadeusz=20Piotr=20=C5=BBo=C5=82nowski?= Date: Sat, 25 Jan 2020 22:18:02 +0000 Subject: [PATCH] Remove no longer needed `xenstore-watch` and `close-window` --- Makefile | 3 --- debian/qubes-core-agent.install | 2 -- misc/.gitignore | 2 -- misc/Makefile | 16 ++----------- misc/close-window.c | 42 --------------------------------- misc/xenstore-watch.c | 29 ----------------------- rpm_spec/core-agent.spec.in | 2 -- 7 files changed, 2 insertions(+), 94 deletions(-) delete mode 100644 misc/close-window.c delete mode 100644 misc/xenstore-watch.c diff --git a/Makefile b/Makefile index c166ba2..a3dd918 100644 --- a/Makefile +++ b/Makefile @@ -200,7 +200,6 @@ install-common: install-doc install -d $(DESTDIR)/var/lib/qubes - install -D misc/xenstore-watch $(DESTDIR)$(BINDIR)/xenstore-watch-qubes install -d $(DESTDIR)/etc/udev/rules.d install -m 0644 misc/udev-qubes-misc.rules $(DESTDIR)/etc/udev/rules.d/50-qubes-misc.rules install -d $(DESTDIR)$(LIBDIR)/qubes/ @@ -221,8 +220,6 @@ install-common: install-doc install -D -m 0644 misc/qubes-master-key.asc $(DESTDIR)/usr/share/qubes/qubes-master-key.asc install misc/resize-rootfs $(DESTDIR)$(LIBDIR)/qubes/ - install misc/close-window $(DESTDIR)$(LIBDIR)/qubes/close-window - install misc/upgrades-installed-check $(DESTDIR)$(LIBDIR)/qubes/upgrades-installed-check install misc/upgrades-status-notify $(DESTDIR)$(LIBDIR)/qubes/upgrades-status-notify diff --git a/debian/qubes-core-agent.install b/debian/qubes-core-agent.install index 1a8879a..a979139 100644 --- a/debian/qubes-core-agent.install +++ b/debian/qubes-core-agent.install @@ -111,11 +111,9 @@ usr/bin/qvm-run-vm usr/bin/qvm-connect-tcp usr/bin/qvm-console usr/bin/qvm-sync-clock -usr/bin/xenstore-watch-qubes usr/lib/python3/dist-packages/qubesagent-*.egg-info/* usr/lib/python3/dist-packages/qubesagent/* usr/lib/qubes-bind-dirs.d/30_cron.conf -usr/lib/qubes/close-window usr/lib/qubes/init/bind-dirs.sh usr/lib/qubes/init/control-printer-icon.sh usr/lib/qubes/init/functions diff --git a/misc/.gitignore b/misc/.gitignore index b84ccbc..03034a9 100644 --- a/misc/.gitignore +++ b/misc/.gitignore @@ -1,3 +1 @@ meminfo-writer -xenstore-watch -close-window diff --git a/misc/Makefile b/misc/Makefile index 5001802..f67a0be 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -1,16 +1,4 @@ -CC=gcc -CFLAGS=-Wall -Wextra -Werror -g -O3 - -_XENSTORE_H=$(wildcard /usr/include/xenstore.h) -ifneq "$(_XENSTORE_H)" "" - CFLAGS+= -DUSE_XENSTORE_H -endif - -all: xenstore-watch python close-window -xenstore-watch: xenstore-watch.o - $(CC) -o xenstore-watch xenstore-watch.o -lxenstore -close-window: close-window.c - $(CC) -o $@ $< -lX11 +all: python python: python2 python3 python2: rm -rf py2 @@ -28,4 +16,4 @@ python3: python3 -O -m compileall py3 clean: - rm -f xenstore-watch *.o *~ *.pyc *.pyo + rm -f *~ *.pyc *.pyo diff --git a/misc/close-window.c b/misc/close-window.c deleted file mode 100644 index 645cd7a..0000000 --- a/misc/close-window.c +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include -#include -#include - -int close_window(Display *d, XID window) { - XClientMessageEvent ev; - memset(&ev, 0, sizeof(ev)); - ev.type = ClientMessage; - ev.display = d; - ev.window = window; - ev.format = 32; - ev.message_type = XInternAtom(d, "WM_PROTOCOLS", False); - ev.data.l[0] = XInternAtom(d, "WM_DELETE_WINDOW", False);; - return XSendEvent(ev.display, ev.window, True, 0, (XEvent *) & ev); -} - -int is_window_visible(Display *d, XID window) { - XWindowAttributes xwa; - - if (!XGetWindowAttributes(d, window, &xwa)) - return 0; - return xwa.map_state == IsViewable; -} - -int main(int argc, char **argv) { - int i; - Display *d; - XID w; - - d = XOpenDisplay(NULL); - if (!d) - exit(1); - for (i=1; i -#include -#include -#include -int main(int argc, char **argv) -{ - struct xs_handle *xs; - unsigned int count; - char **vec; - char dummy; - if (argc != 2) { - fprintf(stderr, "usage: %s xenstore_path\n", argv[0]); - exit(1); - } - xs = xs_domain_open(); - if (!xs) { - perror("xs_domain_open"); - exit(1); - } - if (!xs_watch(xs, argv[1], &dummy)) { - perror("xs_watch"); - exit(1); - } - vec = xs_read_watch(xs, &count); - free(vec); - vec = xs_read_watch(xs, &count); - free(vec); - return 0; -} diff --git a/rpm_spec/core-agent.spec.in b/rpm_spec/core-agent.spec.in index af6fda3..7534d1e 100644 --- a/rpm_spec/core-agent.spec.in +++ b/rpm_spec/core-agent.spec.in @@ -615,7 +615,6 @@ rm -f %{name}-%{version} /usr/bin/qvm-run-vm /usr/bin/qvm-features-request /usr/bin/qvm-sync-clock -/usr/bin/xenstore-watch-qubes /usr/bin/qubes-desktop-run /usr/bin/qubes-run-terminal /usr/bin/qubes-run-gnome-terminal @@ -635,7 +634,6 @@ rm -f %{name}-%{version} /usr/lib/qubes/qvm-move-to-vm.kde /usr/lib/qubes/tar2qfile /usr/lib/qubes/vm-file-editor -/usr/lib/qubes/close-window /usr/lib/qubes/xdg-icon /usr/lib/qubes/update-proxy-configs /usr/lib/qubes/upgrades-installed-check