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:
Gregory Nutt
2018-01-30 17:57:36 -06:00
parent 30f2927101
commit 3521aaf944
28 changed files with 30 additions and 34 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;
}