Or genromfs failed to generate the right romfs.img
Change-Id: Icbcc2e89da1ede644b994d33e70f1a48662c412b
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Per the Linux man page, "By default, getopt() permutes the contents of argv as it scans, so that eventually all the nonoptions are at the end." This behavior, however, is not implemented in the NuttX getopt() logic.
The Linux man page requires that the getopt_long() and getopt_long_only() functions accept arguments to options in a form like:
--option=argument
This PR adds that missing functionality.
This change effects only getopt_long() and getopt_long_only()
Tested on a simulator NSH configuration with a modified version of the getopt() test in apps/testing/ostest.
If an unrecognized long option is encountered, we must skip over that argv[] entry or getopt_long() will seriously misbehave.
Affects getopt_long() and getopt_long_only()
Problem found and fix verified with an updated version of the OS test.
Found a place in getopt_common() where the option string is used before it is checked if it is NULL. This can happen because the short option string is optional for getopt_long() and getopt_long_only()
If optstring is NULL, that would be an ERROR for getopt(), but not for the getopt_long() versions.
Should effect only the getopt() APIs
Tested on the simulator using apps/testing/ostest.
Several licenses were missed in the initial work
David Sidrane has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
1. Null pointer dereference:
- for (ndx = 0; longopts[ndx].name[0] != '\0'; ndx++)
+ for (ndx = 0; longopts[ndx].name != NULL; ndx++)
2. Handle single character long options. An option like -x could be either a short option or a long option (under getopt_long_only()). This case was not being handled correctly.
3. Add missing support for optional arguments to short options (indicated with two "::"
This effects all members of the getopt() family of APIs.
Tested on the simulator using extensions to apps/testing/ostest.
Add implementations of getopt_long() and getopt_long_only()
There could be impacts to getop() since that implementation is shared withe new getopts_long() and getops_long_only() implementation.
Tested using a modified version of sim:nsh
Since 7a046358d9 the top-level COPYING
file has been deleted and replaced by DISCLAIMER, LICENSE, and NOTICE
files. However, some references to the old COPYING file remained in
Kconfig help text and documentation.
Documentation/contributing/coding_style.rst:
Documentation/introduction/about.rst:
boards/arm/lpc17xx_40xx/olimex-lpc1766stk/README.txt:
boards/arm/sam34/arduino-due/README.txt:
boards/arm/sam34/sam4l-xplained/README.txt:
boards/arm/sama5/giant-board/README.md:
boards/arm/sama5/sama5d2-xult/README.txt:
boards/arm/sama5/sama5d4-ek/README.txt:
boards/arm/samd2l2/samd20-xplained/README.txt:
boards/arm/samd2l2/samd21-xplained/README.txt:
boards/arm/samd2l2/saml21-xplained/README.txt:
boards/arm/stm32/hymini-stm32v/README.txt:
boards/arm/stm32/stm3210e-eval/README.txt:
fs/fat/Kconfig:
libs/libc/string/Kconfig:
* Updates stale references to the old top-level COPYING file to
either LICENSE or NOTICE (or both), as appropriate in each
instance.
Mark Schulte has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Pierre-Noel Bouteville has submitted the ICLA and we can migrate the licenses
to Apache.
David Sidrane has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Uros Platise has submitted the ICLA and we can migrate the licenses
to Apache.
David Sidrane has submitted the ICLA and we can migrate the licenses
to Apache.
Bob Feretich has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Johannes Schock has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
getopt() in the FLAT build environment is not thread safe. This is because global variables that are process-specific in Unix are truly global in the FLAT build. Moving the getopt() variables into TLS resolves this issue.
No side-effects are expected other than to getopt()
Tested with sim:nsh
OpenGroup specification was updated regarding the return value for
pthread_once, which after Issue 7 states that "the [EINVAL] error for an
uninitialized pthread_once_t object is removed; this condition results
in undefined behavior".
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Several files were missed in the past
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
David Sidrane has submitted the ICL and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
David S. Alessio has submitted the ICL and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>