aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/musl-support.patch
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2014-03-24 02:35:34 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2014-03-24 02:35:34 +0000
commitf8df3862252ef63ea3d78dc494c49c7fd49f3e82 (patch)
tree1497bd6945c0163d86805dc17d3490db68f0426f /main/xen/musl-support.patch
parent8ee985932efeba1a5a0d811e43d2258c5428702d (diff)
downloadaports-f8df3862252ef63ea3d78dc494c49c7fd49f3e82.tar.bz2
aports-f8df3862252ef63ea3d78dc494c49c7fd49f3e82.tar.xz
main/xen: further work on musl
Diffstat (limited to 'main/xen/musl-support.patch')
-rw-r--r--main/xen/musl-support.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/main/xen/musl-support.patch b/main/xen/musl-support.patch
new file mode 100644
index 0000000000..8236a927d0
--- /dev/null
+++ b/main/xen/musl-support.patch
@@ -0,0 +1,54 @@
+--- xen-4.3.1.orig/m4/ptyfuncs.m4
++++ xen-4.3.1/m4/ptyfuncs.m4
+@@ -10,7 +10,7 @@
+ ])
+ AX_SAVEVAR_RESTORE(CPPFLAGS)
+ AC_CACHE_CHECK([for openpty et al], [ax_cv_ptyfuncs_libs], [
+- for ax_cv_ptyfuncs_libs in -lutil "" NOT_FOUND; do
++ for ax_cv_ptyfuncs_libs in -lc -lutil "" NOT_FOUND; do
+ if test "x$ax_cv_ptyfuncs_libs" = "xNOT_FOUND"; then
+ AC_MSG_FAILURE([Unable to find library for openpty and login_tty])
+ fi
+--- xen-4.3.1.orig/m4/ptyfuncs.m4
++++ xen-4.3.1/m4/ptyfuncs.m4
+@@ -22,7 +22,6 @@
+ #endif
+ int main(void) {
+ openpty(0,0,0,0,0);
+- login_tty(0);
+ }
+ ])],[
+ break
+--- xen-4.3.1.orig/tools/libxl/libxl_bootloader.c
++++ xen-4.3.1/tools/libxl/libxl_bootloader.c
+@@ -85,6 +85,21 @@
+
+ /*----- synchronous subroutines -----*/
+
++static int setup_console_tty(int fd)
++{
++ (void) setsid();
++#ifdef TIOCSCTTY
++ if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1)
++ return (-1);
++#endif
++ (void) dup2(fd, 0);
++ (void) dup2(fd, 1);
++ (void) dup2(fd, 2);
++ if (fd > 2)
++ (void) close(fd);
++ return (0);
++}
++
+ static int setup_xenconsoled_pty(libxl__egc *egc, libxl__bootloader_state *bl,
+ char *slave_path, size_t slave_path_len)
+ {
+@@ -548,7 +563,7 @@
+
+ if (!pid) {
+ /* child */
+- r = login_tty(libxl__carefd_fd(bl->ptys[0].slave));
++ r = setup_console_tty(libxl__carefd_fd(bl->ptys[0].slave));
+ if (r) { LOGE(ERROR, "login_tty failed"); exit(-1); }
+ libxl__exec(gc, -1, -1, -1, bl->args[0], (char **) bl->args, env);
+ exit(-1);