bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: openpty: Skip test if no pty is available


From: Guido Günther
Subject: Re: openpty: Skip test if no pty is available
Date: Thu, 9 Feb 2017 15:11:13 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Thu, Jan 19, 2017 at 07:14:54PM +0100, Guido Günther wrote:
> In chroots for package builds there may be no ptys or they might not be
> accessible. This both manifests as ENOENT on Linux. Skip tests in this
> case.
> ---

Any chance this gets applied?
Cheers,
 -- Guido

>  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..603c5f2 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 != ENOENT) {
> +            fprintf (stderr, "openpty returned %d: %s\n", res, 
> strerror(errno));
> +            return 1;
> +          } else {
> +            return 77;
> +          }
>          }
>      }
>  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]