mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 04:33:33 +08:00
Manually fixup merge botches via direct comparison with NuttX r5447.
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#ifndef CONFIG_BINFMT_DISABLE
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
|
||||
|
||||
@@ -2,3 +2,8 @@
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see misc/tools/kconfig-language.txt.
|
||||
#
|
||||
|
||||
config NXFLAT_DUMPBUFFER
|
||||
bool "Dump NXFLAT buffers"
|
||||
default n
|
||||
depends on DEBUG && DEBUG_VERBOSE
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
@@ -112,8 +112,9 @@ int nxflat_init(const char *filename, struct nxflat_loadinfo_s *loadinfo)
|
||||
loadinfo->filfd = open(filename, O_RDONLY);
|
||||
if (loadinfo->filfd < 0)
|
||||
{
|
||||
bdbg("Failed to open NXFLAT binary %s: %d\n", filename, ret);
|
||||
return -errno;
|
||||
int errval = errno;
|
||||
bdbg("Failed to open NXFLAT binary %s: %d\n", filename, errval);
|
||||
return -errval;
|
||||
}
|
||||
|
||||
/* Read the NXFLAT header from offset 0 */
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
@@ -129,8 +129,9 @@ int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer, int readsize,
|
||||
rpos = lseek(loadinfo->filfd, offset, SEEK_SET);
|
||||
if (rpos != offset)
|
||||
{
|
||||
bdbg("Failed to seek to position %d: %d\n", offset, errno);
|
||||
return -errno;
|
||||
int errval = errno;
|
||||
bdbg("Failed to seek to position %d: %d\n", offset, errval);
|
||||
return -errval;
|
||||
}
|
||||
|
||||
/* Read the file data at offset into the user buffer */
|
||||
@@ -138,10 +139,11 @@ int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer, int readsize,
|
||||
nbytes = read(loadinfo->filfd, bufptr, bytesleft);
|
||||
if (nbytes < 0)
|
||||
{
|
||||
if (errno != EINTR)
|
||||
int errval = errno;
|
||||
if (errval != EINTR)
|
||||
{
|
||||
bdbg("Read of .data failed: %d\n", errno);
|
||||
return -errno;
|
||||
bdbg("Read of .data failed: %d\n", errval);
|
||||
return -errval;
|
||||
}
|
||||
}
|
||||
else if (nbytes == 0)
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
#include <unistd.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
@@ -56,10 +57,6 @@
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxflat_swap32
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
@@ -42,8 +42,9 @@
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -91,10 +92,10 @@ int nxflat_verifyheader(const struct nxflat_hdr_s *header)
|
||||
if (strncmp(header->h_magic, NXFLAT_MAGIC, 4) != 0)
|
||||
{
|
||||
bdbg("Unrecognized magic=\"%c%c%c%c\"\n",
|
||||
header->h_magic[0], header->h_magic[1],
|
||||
header->h_magic[2], header->h_magic[3]);
|
||||
header->h_magic[0], header->h_magic[1],
|
||||
header->h_magic[2], header->h_magic[3]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
||||
Reference in New Issue
Block a user