mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +08:00
nuttx/sched: Remove explicit references to errno. That is a problem from within the kernel for certain configurations
This commit is contained in:
parent
0ab1b0de25
commit
89593969be
4 changed files with 15 additions and 15 deletions
|
@ -185,7 +185,7 @@ int exec_module(FAR const struct binary_s *binp)
|
|||
#endif
|
||||
if (ret < 0)
|
||||
{
|
||||
err = errno;
|
||||
err = get_errno();
|
||||
bdbg("task_init() failed: %d\n", err);
|
||||
goto errout_with_stack;
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ int exec_module(FAR const struct binary_s *binp)
|
|||
ret = task_activate((FAR struct tcb_s *)tcb);
|
||||
if (ret < 0)
|
||||
{
|
||||
err = errno;
|
||||
err = get_errno();
|
||||
bdbg("task_activate() failed: %d\n", err);
|
||||
goto errout_with_stack;
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ errout_with_stack:
|
|||
errout_with_tcb:
|
||||
kfree(tcb);
|
||||
errout:
|
||||
errno = err;
|
||||
set_errno(err);
|
||||
bdbg("returning errno: %d\n", err);
|
||||
return ERROR;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ static int load_default_priority(FAR struct binary_s *bin)
|
|||
ret = sched_getparam(0, ¶m);
|
||||
if (ret < 0)
|
||||
{
|
||||
bdbg("ERROR: sched_getparam failed: %d\n", errno);
|
||||
bdbg("ERROR: sched_getparam failed: %d\n", get_errno());
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ int load_module(FAR struct binary_s *bin)
|
|||
if (ret < 0)
|
||||
{
|
||||
bdbg("Returning errno %d\n", -ret);
|
||||
errno = -ret;
|
||||
set_errno(-ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ static int builtin_loadbinary(struct binary_s *binp)
|
|||
fd = open(binp->filename, O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
bdbg("ERROR: Failed to open binary %s: %d\n", binp->filename, errval);
|
||||
return -errval;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ static int builtin_loadbinary(struct binary_s *binp)
|
|||
ret = ioctl(fd, FIOC_FILENAME, (unsigned long)((uintptr_t)&filename));
|
||||
if (ret < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
bdbg("ERROR: FIOC_FILENAME ioctl failed: %d\n", errval);
|
||||
return -errval;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ static int builtin_loadbinary(struct binary_s *binp)
|
|||
index = builtin_isavail(filename);
|
||||
if (index < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
bdbg("ERROR: %s is not a builtin application\n", filename);
|
||||
return -errval;
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ static int pcode_mount_testfs(void)
|
|||
"romfs", MS_RDONLY, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
DEBUGASSERT(errval > 0);
|
||||
|
||||
bdbg("ERROR: mount(%s,%s,romfs) failed: %d\n",
|
||||
|
@ -265,7 +265,7 @@ static int pcode_proxy(int argc, char **argv)
|
|||
ret = on_exit(pcode_onexit, binp);
|
||||
if (ret < 0)
|
||||
{
|
||||
bdbg("ERROR: on_exit failed: %d\n", errno);
|
||||
bdbg("ERROR: on_exit failed: %d\n", get_errno());
|
||||
kfree(fullpath);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ static int pcode_load(struct binary_s *binp)
|
|||
fd = open(binp->filename, O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
bdbg("ERROR: Failed to open binary %s: %d\n", binp->filename, errval);
|
||||
return -errval;
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ static int pcode_load(struct binary_s *binp)
|
|||
* simply interrupted by a signal.
|
||||
*/
|
||||
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
DEBUGASSERT(errval > 0);
|
||||
|
||||
if (errval != EINTR)
|
||||
|
@ -383,7 +383,7 @@ static int pcode_load(struct binary_s *binp)
|
|||
do
|
||||
{
|
||||
ret = sem_wait(&g_pcode_handoff.exclsem);
|
||||
DEBUGASSERT(ret == OK || errno == EINTR);
|
||||
DEBUGASSERT(ret == OK || get_errno() == EINTR);
|
||||
}
|
||||
while (ret < 0);
|
||||
|
||||
|
@ -508,7 +508,7 @@ void pcode_uninitialize(void)
|
|||
ret = unregister_binfmt(&g_pcode_binfmt);
|
||||
if (ret < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
DEBUGASSERT(errval > 0);
|
||||
|
||||
bdbg("ERROR: unregister_binfmt() failed: %d\n", errval);
|
||||
|
@ -519,7 +519,7 @@ void pcode_uninitialize(void)
|
|||
ret = umount(CONFIG_PCODE_TEST_MOUNTPOINT);
|
||||
if (ret < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
DEBUGASSERT(errval > 0);
|
||||
|
||||
bdbg("ERROR: umount(%s) failed: %d\n", CONFIG_PCODE_TEST_MOUNTPOINT, errval);
|
||||
|
|
Loading…
Reference in a new issue