mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 18:58:27 +08:00
Squashed commit of the following:
binfmt/, configs/, grahics/, libc/, mm/, net/, sched/: OS references to the errno variable should always use the set_errno(), get_errno() macros
arch/arm/src/stm32 and stm32f7: Architecture-specific code is not permitted to modify the errno variable. drivers/ and libc/: OS references to the errno variable should always use the set_errno(), get_errno() macros
This commit is contained in:
@@ -98,7 +98,7 @@ static inline int modlib_filelen(FAR struct mod_loadinfo_s *loadinfo,
|
||||
ret = stat(filename, &buf);
|
||||
if (ret < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
serr("ERROR: Failed to stat file: %d\n", errval);
|
||||
return -errval;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ int modlib_initialize(FAR const char *filename,
|
||||
loadinfo->filfd = open(filename, O_RDONLY);
|
||||
if (loadinfo->filfd < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
serr("ERROR: Failed to open ELF binary %s: %d\n", filename, errval);
|
||||
return -errval;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ int modlib_read(FAR struct mod_loadinfo_s *loadinfo, FAR uint8_t *buffer,
|
||||
rpos = lseek(loadinfo->filfd, offset, SEEK_SET);
|
||||
if (rpos != offset)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
serr("ERROR: Failed to seek to position %lu: %d\n",
|
||||
(unsigned long)offset, errval);
|
||||
return -errval;
|
||||
|
||||
Reference in New Issue
Block a user