unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
To: Florian Weimer <fw@deneb.enyo.de>,
	Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH 1/3] login/tst-grantpt: Convert to support framework, more error checking
Date: Thu, 13 Aug 2020 15:58:39 -0300	[thread overview]
Message-ID: <27243845-7d07-92fb-aa82-8317449d8dc7@linaro.org> (raw)
In-Reply-To: <87r1sapfdi.fsf@mid.deneb.enyo.de>



On 13/08/2020 15:31, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>>> +  xclose (fd);
>>>    ret = grantpt (fd);
>>>    err = errno;
>>>    if (ret != -1 || err != EBADF)
>>>      {
>>> +      support_record_failure ();
>>>        printf ("grantpt(): expected: return = %d, errno = %d\n", -1, EBADF);
>>>        printf ("           got: return = %d, errno = %d\n", ret, err);
>>> -      return 1;
>>>      }
>>> -  return 0;
>>>  }
>>
>> Ok (although maybe use CHECK_VERIFY?).
> 
> Do you mean TEST_VERIFY?  That can't produce a log message.  We
> probably should have something that logs a failure unconditionally.
> 

Yeap, TEST_VERIFY.  The test failure output will have all the required
information anyway (either if return code or errno does not match
expectations).

>>> -  unlink (file);
>>> +  fd = create_temp_file ("tst-grantpt-", NULL);
>>> +  TEST_VERIFY_EXIT (fd >= 0);
>>>  
>>
>> Ok.  As a side note, maybe we should add a xcreate_temp_file.
> 
> I think we should change the semantics of the existing function
> instead.
> 

The posix/tst-spawn3.c uses create_temp_file to fill all possible file-descriptor
to check if posix_spawn file actions does not use extra descriptors.  Afaik it
is a exception, all other tests expect that create_temp_file does not fail.

  reply	other threads:[~2020-08-13 18:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05  7:14 [PATCH 1/3] login/tst-grantpt: Convert to support framework, more error checking Florian Weimer via Libc-alpha
2020-08-05  7:14 ` [PATCH 2/3] Linux: unlockpt needs to fail with EINVAL, not ENOTTY (bug 26053) Florian Weimer via Libc-alpha
2020-08-13 18:30   ` Adhemerval Zanella via Libc-alpha
2020-08-05  7:14 ` [PATCH 3/3] Linux: Require properly configured /dev/pts for PTYs Florian Weimer via Libc-alpha
2020-08-13 18:53   ` Adhemerval Zanella via Libc-alpha
2020-08-13 18:21 ` [PATCH 1/3] login/tst-grantpt: Convert to support framework, more error checking Adhemerval Zanella via Libc-alpha
2020-08-13 18:31   ` Florian Weimer
2020-08-13 18:58     ` Adhemerval Zanella via Libc-alpha [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-05-27 10:14 [PATCH 0/3] Linux: Rework Linux PTY support Florian Weimer via Libc-alpha
2020-05-27 10:14 ` [PATCH 1/3] login/tst-grantpt: Convert to support framework, more error checking Florian Weimer via Libc-alpha
2020-10-02 17:08   ` Adhemerval Zanella via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27243845-7d07-92fb-aa82-8317449d8dc7@linaro.org \
    --to=libc-alpha@sourceware.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fw@deneb.enyo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).