From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/5] tst_safe_macros: add SAFE_GETGRGID()
Date: Wed, 3 Oct 2018 09:46:23 +0200 [thread overview]
Message-ID: <20181003074623.GC23398@rei> (raw)
In-Reply-To: <43441f97-3b86-e646-2693-4f396fa40ff6@suse.de>
Hi!
> >> + rval = getgrgid(gid);
> >> + if (rval == NULL) {
> >> + tst_brk_(file, lineno, TBROK | TERRNO,
> >> + "getgrgid(%li) failed", (long)gid);
> >> + }
> >
> > I also wonder if it's okay to break the test in case that the entry
> > wasn't found (the return value would be NULL and errno would be
> > untouched) but I guess that it's OK for most of the cases.
>
> I think so too. Also I thought these safe_* functions are more for
> setting up the test, where it is more likely requesting existing groups.
>
> Maybe for the fallback approach it could be handy. But if we really need
> more then two options, I think passing a array would do it.
> Or should we go with an array now?
Unless there is a case for it I woudln't bother at this point.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2018-10-03 7:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 14:18 [LTP] [PATCH v2 1/5] setregid01: Convert to newlib Clemens Famulla-Conrad
2018-09-10 14:18 ` [LTP] [PATCH v2 2/5] tst_safe_macros: add SAFE_GETGRGID() Clemens Famulla-Conrad
2018-10-02 14:20 ` Cyril Hrubis
2018-10-02 23:23 ` Clemens Famulla-Conrad
2018-10-03 7:46 ` Cyril Hrubis [this message]
2018-09-10 14:18 ` [LTP] [PATCH v2 3/5] setregid02: Convert to newlib Clemens Famulla-Conrad
2018-09-10 14:19 ` [LTP] [PATCH v2 4/5] tst_safe_macros: add SAFE_GETGRNAM_FALLBACK() Clemens Famulla-Conrad
2018-09-10 14:19 ` [LTP] [PATCH v2 5/5] setregid04: Convert to newlib Clemens Famulla-Conrad
2018-09-11 7:42 ` [LTP] [PATCH v2 1/5] setregid01: " Richard Palethorpe
2018-10-02 14:07 ` Cyril Hrubis
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=20181003074623.GC23398@rei \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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