From e5fa610b0d1d69fb6d8c1ab7544ad23d5a2b01ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dav=C3=AD=C3=B0=20Steinn=20Geirsson?= Date: Mon, 21 Apr 2014 15:21:03 +0000 Subject: [PATCH] Use xenstore.h instead of xs.h when xen >= 4.2 --- misc/Makefile | 6 ++++++ misc/xenstore-watch.c | 4 ++++ network/setup-ip | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/misc/Makefile b/misc/Makefile index c9376ce..b0b18ae 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -1,5 +1,11 @@ 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 diff --git a/misc/xenstore-watch.c b/misc/xenstore-watch.c index 61767ec..f0e91e8 100644 --- a/misc/xenstore-watch.c +++ b/misc/xenstore-watch.c @@ -1,5 +1,9 @@ #include +#ifdef USE_XENSTORE_H +#include +#else #include +#endif #include #include int main(int argc, char **argv) diff --git a/network/setup-ip b/network/setup-ip index 7ea5fb9..907a295 100755 --- a/network/setup-ip +++ b/network/setup-ip @@ -3,7 +3,7 @@ if [ -x /usr/sbin/xenstore-read ]; then XENSTORE_READ="/usr/sbin/xenstore-read" else - XENSTORE_READ="$XENSTORE_READ" + XENSTORE_READ="/usr/bin/xenstore-read" fi ip=`$XENSTORE_READ qubes-ip 2> /dev/null`