]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: Portability fixes for pty handling, in libxl_osdeps.h
authorChristoph Egger <Christoph.Egger@amd.com>
Thu, 29 Jul 2010 15:12:50 +0000 (16:12 +0100)
committerChristoph Egger <Christoph.Egger@amd.com>
Thu, 29 Jul 2010 15:12:50 +0000 (16:12 +0100)
This is the same approach used in tools/console, although we have a
separate instance of it as it is difficult to share code between these
two places.

Also add a missing include of <termios.h>, and fix a literal use of
-lutil to refer to UTIL_LIBS.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/Makefile
tools/libxl/libxl_bootloader.c
tools/libxl/libxl_osdeps.h

index 7303fd37a039a0c0519e212443696481faeacc43..32c96405658a9413dd370ab18946a8a748697a27 100644 (file)
@@ -15,7 +15,7 @@ CFLAGS += -Werror -Wno-format-zero-length
 CFLAGS += -I. -fPIC
 CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl)
 
-LIBS = $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenguest) $(LDFLAGS_libxenstore) $(LDFLAGS_libblktapctl) -lutil
+LIBS = $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenguest) $(LDFLAGS_libxenstore) $(LDFLAGS_libblktapctl) $(UTIL_LIBS)
 
 LIBXL_OBJS-y = osdeps.o libxl_paths.o libxl_bootloader.o
 LIBXL_OBJS = flexarray.o libxl.o libxl_pci.o libxl_dom.o libxl_exec.o libxl_xshelp.o libxl_device.o libxl_internal.o xenguest.o libxl_utils.o $(LIBXL_OBJS-y)
index 28a92f83b20b01fc12bb28897d038bf5491bfc6c..e9c9c2f59f3c05371e43a9af88f1c2e5c5af8087 100644 (file)
@@ -15,9 +15,9 @@
 #include "libxl_osdeps.h"
 
 #include <string.h>
-#include <pty.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <termios.h>
 
 #include <sys/stat.h>
 #include <sys/types.h>
index fc453c3553c4f81a09ea6e018fc639f5fe5d7352..985a5ffa8a702278f3c75bd5003e27c23b87a8ec 100644 (file)
 
 #define _GNU_SOURCE
 
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+#include <util.h>
+#elif defined(__linux__)
+#include <pty.h>
+#elif defined(__sun__)
+#include <stropts.h>
+#endif
+
 #ifdef NEED_OWN_ASPRINTF
 #include <stdarg.h>