getauxval: fall through to auxv gfter getauxval errno test
if when we need to determine if getauxval sets errno, we determine it doesn't after getting a 0 return code, make sure we return a value, since we didn't previously. fall through to code we'd otherwise have called in this case above.
This commit is contained in:

committed by
Jeffrey Altman

parent
7ee3cc6855
commit
6aece8ea06
@@ -159,6 +159,7 @@ rk_getprocauxval(unsigned long type)
|
|||||||
ROKEN_LIB_FUNCTION unsigned long ROKEN_LIB_CALL
|
ROKEN_LIB_FUNCTION unsigned long ROKEN_LIB_CALL
|
||||||
rk_getauxval(unsigned long type)
|
rk_getauxval(unsigned long type)
|
||||||
{
|
{
|
||||||
|
const auxv_t *a;
|
||||||
#ifdef HAVE_GETAUXVAL
|
#ifdef HAVE_GETAUXVAL
|
||||||
#ifdef GETAUXVAL_SETS_ERRNO
|
#ifdef GETAUXVAL_SETS_ERRNO
|
||||||
if (rk_injected_auxv)
|
if (rk_injected_auxv)
|
||||||
@@ -184,8 +185,6 @@ rk_getauxval(unsigned long type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (getauxval_sets_errno == 0) {
|
if (getauxval_sets_errno == 0) {
|
||||||
const auxv_t *a;
|
|
||||||
|
|
||||||
errno = save_errno;
|
errno = save_errno;
|
||||||
a = rk_getauxv(type);
|
a = rk_getauxv(type);
|
||||||
if (a == NULL) {
|
if (a == NULL) {
|
||||||
@@ -214,15 +213,12 @@ rk_getauxval(unsigned long type)
|
|||||||
getauxval_sets_errno = 0;
|
getauxval_sets_errno = 0;
|
||||||
errno = save_errno;
|
errno = save_errno;
|
||||||
#endif
|
#endif
|
||||||
#else
|
#endif
|
||||||
const auxv_t *a;
|
|
||||||
|
|
||||||
if ((a = rk_getauxv(type)) == NULL) {
|
if ((a = rk_getauxv(type)) == NULL) {
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return a->a_un.a_val;
|
return a->a_un.a_val;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user