[Pkg-libvirt-commits] [libvirt] 02/10: Work around lack of /dev/ptmx access in pbuilder

Guido Guenther agx at moszumanska.debian.org
Thu Jan 19 18:55:01 UTC 2017


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to branch debian/experimental
in repository libvirt.

commit 2be70b38b98a681687cc811c5df7f336671556a4
Author: Guido Günther <agx at sigxcpu.org>
Date:   Thu Jan 19 17:21:35 2017 +0100

    Work around lack of /dev/ptmx access in pbuilder
    
    test-posix_openpt-don-t-fail-on-EPERM.patch
    openpty-Skip-test-if-no-pty-is-available.patch
---
 .../openpty-Skip-test-if-no-pty-is-available.patch | 38 ++++++++++++++++++++++
 debian/patches/series                              |  2 ++
 .../test-posix_openpt-don-t-fail-on-EPERM.patch    | 23 +++++++++++++
 3 files changed, 63 insertions(+)

diff --git a/debian/patches/openpty-Skip-test-if-no-pty-is-available.patch b/debian/patches/openpty-Skip-test-if-no-pty-is-available.patch
new file mode 100644
index 0000000..f3ad289
--- /dev/null
+++ b/debian/patches/openpty-Skip-test-if-no-pty-is-available.patch
@@ -0,0 +1,38 @@
+From: =?utf-8?q?Guido_G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Thu, 19 Jan 2017 17:16:06 +0100
+Subject: openpty: Skip test if no pty is available
+
+In chroots created for package builds created by pbuilder there may be
+no ptys or they might not be accessible. This both manifests as ENOENT
+on Linux.
+---
+ gnulib/tests/test-openpty.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/gnulib/tests/test-openpty.c b/gnulib/tests/test-openpty.c
+index 2858d50..004e2d6 100644
+--- a/gnulib/tests/test-openpty.c
++++ b/gnulib/tests/test-openpty.c
+@@ -25,6 +25,7 @@
+ SIGNATURE_CHECK (openpty, int, (int *, int *, char *, struct termios const *,
+                                 struct winsize const *));
+ 
++#include <errno.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <termios.h>
+@@ -43,8 +44,12 @@ main ()
+       int res = openpty (&master, &slave, NULL, NULL, NULL);
+       if (res != 0)
+         {
+-          fprintf (stderr, "openpty returned %d\n", res);
+-          return 1;
++          if (errno != ENENT) {
++            fprintf (stderr, "openpty returned %d: %s\n", res, strerror(errno));
++            return 1;
++          } else {
++            return 77;
++          }
+         }
+     }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 194f997..dea127f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -15,3 +15,5 @@ debian/apparmor_profiles_local_include.patch
 virt-aa-helper-apparmor-allow-usr-share-OVMF-too.patch
 Set-defaults-for-zfs-tools.patch
 Pass-GPG_TTY-env-var-to-the-ssh-binary.patch
+openpty-Skip-test-if-no-pty-is-available.patch
+test-posix_openpt-don-t-fail-on-EPERM.patch
diff --git a/debian/patches/test-posix_openpt-don-t-fail-on-EPERM.patch b/debian/patches/test-posix_openpt-don-t-fail-on-EPERM.patch
new file mode 100644
index 0000000..d7ec852
--- /dev/null
+++ b/debian/patches/test-posix_openpt-don-t-fail-on-EPERM.patch
@@ -0,0 +1,23 @@
+From: =?utf-8?q?Guido_G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Thu, 19 Jan 2017 17:19:38 +0100
+Subject: test-posix_openpt: don't fail on EPERM
+
+In chroots created for Debian package builds created by pbuilder
+/dev/ptmx might not be accessible.
+---
+ gnulib/tests/test-posix_openpt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gnulib/tests/test-posix_openpt.c b/gnulib/tests/test-posix_openpt.c
+index 87243b2..9bd7db4 100644
+--- a/gnulib/tests/test-posix_openpt.c
++++ b/gnulib/tests/test-posix_openpt.c
+@@ -43,7 +43,7 @@ main (void)
+ 
+   /* Open the master of a pseudo-terminal pair.  */
+   master = posix_openpt (O_RDWR | O_NOCTTY);
+-  if (master < 0 && errno == ENOSYS)
++  if (master < 0 && (errno == ENOSYS || errno == EPERM))
+     {
+       fputs ("skipping: platform lacks pty support\n", stderr);
+       return 77;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libvirt.git



More information about the Pkg-libvirt-commits mailing list