[LTP] [RFC PATCH v2 1/2] lib: TCONF on "not supported" errnos in SAFE_SOCKET()
Alexey Kodanev
alexey.kodanev@oracle.com
Thu Mar 1 16:43:21 CET 2018
On 03/01/2018 01:59 PM, Petr Vorel wrote:
> *NOSUPPORT errnos likely mean there is configuration issue rather than
> test failure.
>
> e.g. missing dccp module in netstress.c which was sofar set as TBROK:
> safe_net.c:117: BROK: netstress.c:654: socket(10, 6, 33) failed: ESOCKTNOSUPPORT
>
...
>
> if (rval < 0) {
> - tst_brkm(TBROK | TERRNO, cleanup_fn,
> - "%s:%d: socket(%d, %d, %d) failed", file, lineno,
> - domain, type, protocol);
> + switch (errno) {
> + case EPROTONOSUPPORT:
> + case ESOCKTNOSUPPORT:
> + case EOPNOTSUPP:
> + case EPFNOSUPPORT:
> + case EAFNOSUPPORT:
> + ttype = TCONF;
> + break;
> + default:
> + ttype = TBROK;
> + }
> +
> + tst_brkm(ttype | TERRNO, cleanup_fn, "%s:%d: socket(%d, %d, %d) failed",
Looks like this line is over 80 chars. Otherwise looks good to me.
Thanks,
Alexey
More information about the ltp
mailing list