From: Carlos O'Donell <carlos@redhat.com>
To: Florian Weimer <fweimer@redhat.com>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v3] Add cancellation regression test for getpwuid_r.
Date: Fri, 09 Dec 2016 19:40:00 -0000 [thread overview]
Message-ID: <f78c9ee4-8287-db11-6390-5152432cf694@redhat.com> (raw)
In-Reply-To: <4c7c6c97-3bf5-2c92-5e2a-70443039b3e3@redhat.com>
On 12/08/2016 07:13 PM, Carlos O'Donell wrote:
> On 12/08/2016 02:02 PM, Mike Frysinger wrote:
>> On 08 Dec 2016 12:15, Carlos O'Donell wrote:
>>> +static void *
>>> +worker( void *arg )
>>
>> seems like this test case is mingling code from diff sources since it has
>> diff styles. there's a number of non-GNU style errors in it -- this is
>> just the first one i saw.
>
> I started with an uncontributed internal Red Hat reproducer, but all that
> was left by the time I was done was a few lines, which you're right, have
> all the wrong style.
>
>>> +{
>>> + int ret;
>>> + unsigned int iter = 0;
>>> + struct passwd pwbuf, *pw;
>>> + uid_t uid;
>>> + uid = geteuid();
>>> + /* Use a reasonable sized buffer. Note that _SC_GETPW_R_SIZE_MAX is
>>> + just a hint and not any kind of maximum value. */
>>> + wbufsz = sysconf(_SC_GETPW_R_SIZE_MAX);
>>> + if (wbufsz == -1)
>>> + wbufsz = 1024;
>>> + wbuf = xmalloc (wbufsz);
>>> + pthread_cleanup_push (worker_free, wbuf);
>>> + sem_post (&started);
>>> + while (1)
>>
>> this func could do with a few newlines sprinkled around. it's pretty
>> dense to read as-is. actually the whole testcase is written this way :).
>>
>>> + printf ("INFO: Previoulsy we would never get here\n");
>>
>> "Previously"
>>
>>> + printf ("PASS: Cancelled getpwuid_r successfully"
>>
>> "Canceled"
>> -mike
>>
>
> v3
> - Fix two spelling mistakes.
> - Fix GNU Coding Style violations.
> - Add more whitespace to make the test more readable.
I believe v3 addresses Florian and Mike's review.
I'll commit this next week if nobody objects.
--
Cheers,
Carlos.
prev parent reply other threads:[~2016-12-09 19:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 15:42 [PATCH] Add cancellation " Carlos O'Donell
2016-12-05 15:52 ` Florian Weimer
2016-12-08 17:16 ` [PATCH v2] Add cancellation regression " Carlos O'Donell
2016-12-08 19:02 ` Mike Frysinger
2016-12-09 0:13 ` [PATCH v3] " Carlos O'Donell
2016-12-09 10:09 ` Florian Weimer
2016-12-20 20:44 ` [PATCH v4] " Carlos O'Donell
2016-12-21 13:08 ` Florian Weimer
2016-12-23 18:42 ` Carlos O'Donell
2016-12-09 19:40 ` Carlos O'Donell [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f78c9ee4-8287-db11-6390-5152432cf694@redhat.com \
--to=carlos@redhat.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/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).