Skip to content
Commit 2efca218 authored by Stafford Horne's avatar Stafford Horne
Browse files

xsysconf: Only fail on error results and errno set

When testing nptl/tst-pthread-attr-affinity-fail fails with:

    error: xsysconf.c:33: sysconf (83): Cannot allocate memory
    error: 1 test failures

This happens as xsysconf checks the errno after running sysconf.
Internally the sysconf request for _SC_NPROCESSORS_CONF on linux
allocates memory.  But there is a problem, even though malloc succeeds
errno is getting set to ENOMEM.

POSIX allows successful calls to clobber errno.  So xsysconf just
checking errno is wrong.  Fix xsysconf by only failing if we have an
error result and errno is set.
parent 54ff4f1e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment