mirror of
https://github.com/apache/nuttx.git
synced 2025-12-09 03:33:51 +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:
@@ -101,7 +101,7 @@ static inline int elf_filelen(FAR struct elf_loadinfo_s *loadinfo,
|
||||
ret = stat(filename, &buf);
|
||||
if (ret < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
berr("Failed to stat file: %d\n", errval);
|
||||
return -errval;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo)
|
||||
loadinfo->filfd = open(filename, O_RDONLY);
|
||||
if (loadinfo->filfd < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
berr("Failed to open ELF binary %s: %d\n", filename, errval);
|
||||
return -errval;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ int elf_read(FAR struct elf_loadinfo_s *loadinfo, FAR uint8_t *buffer,
|
||||
rpos = lseek(loadinfo->filfd, offset, SEEK_SET);
|
||||
if (rpos != offset)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
berr("Failed to seek to position %lu: %d\n",
|
||||
(unsigned long)offset, errval);
|
||||
return -errval;
|
||||
|
||||
@@ -111,7 +111,7 @@ int nxflat_init(const char *filename, struct nxflat_loadinfo_s *loadinfo)
|
||||
loadinfo->filfd = open(filename, O_RDONLY);
|
||||
if (loadinfo->filfd < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
berr("Failed to open NXFLAT binary %s: %d\n", filename, errval);
|
||||
return -errval;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer,
|
||||
rpos = lseek(loadinfo->filfd, offset, SEEK_SET);
|
||||
if (rpos != offset)
|
||||
{
|
||||
int errval = errno;
|
||||
int errval = get_errno();
|
||||
berr("Failed to seek to position %d: %d\n", offset, errval);
|
||||
return -errval;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user