[LTP] [PATCH v3 4/5] tst_safe_macros: add SAFE_GETGRNAM_FALLBACK()
Cyril Hrubis
chrubis@suse.cz
Thu Oct 11 15:34:23 CEST 2018
Hi!
> +struct group *safe_getgrnam_fallback(const char *file, const int lineno,
> + const char *name, const char *fallback)
> +{
> + struct group *rval;
> +
I've added a missing errno = 0; here and pushed.
Thanks.
> + rval = getgrnam(name);
> + if (rval == NULL) {
> + tst_res_(file, lineno, TINFO,
> + "getgrnam(%s) failed - try fallback %s",
> + name, fallback);
> + rval = safe_getgrnam(file, lineno, fallback);
> + }
> +
> + return rval;
> +}
> +
> struct group *safe_getgrgid(const char *file, const int lineno, gid_t gid)
> {
> struct group *rval;
> --
> 2.16.4
>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list