You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2026/10/19 12:17:44 UTC
(nuttx-apps) branch master updated (bdc11eb94 -> e649e8624)
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
from bdc11eb94 testing/libc/popen: Check the status that pclose() returns.
new a5525a14a system/gdbstub: Fix the nxstyle errors.
new e649e8624 system/popen: Let its users take the popen() of libc too.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
examples/popen/Kconfig | 2 +-
netutils/dhcpd/dhcpd.c | 3 ++-
system/fastboot/Kconfig | 2 +-
system/gdbstub/gdbstub.c | 32 ++++++++++++++++++--------------
testing/libc/popen/Kconfig | 2 +-
5 files changed, 23 insertions(+), 18 deletions(-)
(nuttx-apps) 01/02: system/gdbstub: Fix the nxstyle errors.
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit a5525a14a2599eb8659174a4086af6b5ca951be6
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Sun Oct 18 22:52:16 2026 +0200
system/gdbstub: Fix the nxstyle errors.
Add the blank lines after the declarations and indent the switch block,
as nxstyle requires. No code change.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <ma...@gmail.com>
---
system/gdbstub/gdbstub.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/system/gdbstub/gdbstub.c b/system/gdbstub/gdbstub.c
index 8565efce3..757d31676 100644
--- a/system/gdbstub/gdbstub.c
+++ b/system/gdbstub/gdbstub.c
@@ -49,6 +49,7 @@ static int gdb_monitor(FAR struct gdb_state_s *state, FAR const char *cmd)
while (1)
{
size_t len = fread(buf, 1, sizeof(buf) - 1, file);
+
if (len == 0 && (feof(file) || ferror(file)))
{
break;
@@ -78,6 +79,7 @@ static ssize_t gdb_send(FAR void *priv, FAR const char *buf, size_t len)
while (i < len)
{
ssize_t ret = write(fd, buf + i, len - i);
+
if (ret < 0)
{
return -errno;
@@ -98,6 +100,7 @@ static ssize_t gdb_recv(FAR void *priv, FAR void *buf,
while (i < len)
{
ssize_t ret = read(fd, (FAR char *)buf + i, len - i);
+
if (ret < 0)
{
return -errno;
@@ -144,21 +147,21 @@ int main(int argc, FAR char *argv[])
#endif
{
switch (ret)
- {
- case 'd':
- dev = optarg;
- break;
+ {
+ case 'd':
+ dev = optarg;
+ break;
#ifdef CONFIG_NET
- case 'p':
- port = optarg;
- break;
+ case 'p':
+ port = optarg;
+ break;
#endif
- case 'h':
- case '?':
- default:
- usage(argv[0]);
- break;
- }
+ case 'h':
+ case '?':
+ default:
+ usage(argv[0]);
+ break;
+ }
}
#ifdef CONFIG_NET
(nuttx-apps) 02/02: system/popen: Let its users take the popen() of libc too.
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit e649e86246af8cfff858780de24ba3764d862d5e
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Sun Oct 18 22:51:49 2026 +0200
system/popen: Let its users take the popen() of libc too.
The fastboot shell command, the popen test and the popen example
depended on CONFIG_SYSTEM_POPEN, and dhcpd and gdbstub used popen() only
with it. libc now has popen(), pclose(), dpopen() and dpclose() when
CONFIG_PIPES, CONFIG_LIBC_EXECFUNCS and CONFIG_SCHED_WAITPID are set.
Let these users take either copy, so that a configuration can disable
CONFIG_SYSTEM_POPEN and keep them.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <ma...@gmail.com>
---
examples/popen/Kconfig | 2 +-
netutils/dhcpd/dhcpd.c | 3 ++-
system/fastboot/Kconfig | 2 +-
system/gdbstub/gdbstub.c | 3 ++-
testing/libc/popen/Kconfig | 2 +-
5 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/examples/popen/Kconfig b/examples/popen/Kconfig
index 2f571d121..ebe65d468 100644
--- a/examples/popen/Kconfig
+++ b/examples/popen/Kconfig
@@ -6,7 +6,7 @@
config EXAMPLES_POPEN
tristate "popen() example"
default n
- depends on SYSTEM_POPEN
+ depends on SYSTEM_POPEN || (PIPES && LIBC_EXECFUNCS && SCHED_WAITPID)
depends on !DISABLE_POSIX_TIMERS
---help---
Enable the popen() example
diff --git a/netutils/dhcpd/dhcpd.c b/netutils/dhcpd/dhcpd.c
index e6b469bc8..47e7b737d 100644
--- a/netutils/dhcpd/dhcpd.c
+++ b/netutils/dhcpd/dhcpd.c
@@ -1525,7 +1525,8 @@ static pid_t dhcpd_get_pid(void)
#if !defined(CONFIG_BUILD_KERNEL)
pid = g_dhcpd_daemon.ds_pid;
-#elif defined(CONFIG_SYSTEM_POPEN)
+#elif defined(CONFIG_SYSTEM_POPEN) || (defined(CONFIG_PIPES) && \
+ defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_SCHED_WAITPID))
FAR FILE *fp;
char line[32];
diff --git a/system/fastboot/Kconfig b/system/fastboot/Kconfig
index 966027376..fe0183ac5 100644
--- a/system/fastboot/Kconfig
+++ b/system/fastboot/Kconfig
@@ -58,7 +58,7 @@ config SYSTEM_FASTBOOTD_SHELL
bool "Execute custom commands"
default n
depends on SCHED_CHILD_STATUS
- depends on SYSTEM_POPEN
+ depends on SYSTEM_POPEN || (PIPES && LIBC_EXECFUNCS && SCHED_WAITPID)
---help---
Enable to support executing custom commands.
e.g. fastboot oem shell ps
diff --git a/system/gdbstub/gdbstub.c b/system/gdbstub/gdbstub.c
index 757d31676..a93c8c78d 100644
--- a/system/gdbstub/gdbstub.c
+++ b/system/gdbstub/gdbstub.c
@@ -38,7 +38,8 @@
static int gdb_monitor(FAR struct gdb_state_s *state, FAR const char *cmd)
{
-#ifdef CONFIG_SYSTEM_POPEN
+#if defined(CONFIG_SYSTEM_POPEN) || (defined(CONFIG_PIPES) && \
+ defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_SCHED_WAITPID))
FAR FILE *file;
file = popen(cmd, "r");
diff --git a/testing/libc/popen/Kconfig b/testing/libc/popen/Kconfig
index 73d4beb36..acb2dacc5 100644
--- a/testing/libc/popen/Kconfig
+++ b/testing/libc/popen/Kconfig
@@ -6,7 +6,7 @@
config TESTING_POPEN
tristate "popen()/dpopen() test"
default n
- depends on SYSTEM_POPEN
+ depends on SYSTEM_POPEN || (PIPES && LIBC_EXECFUNCS && SCHED_WAITPID)
---help---
Test popen()/pclose() and dpopen()/dpclose() in both shell
and no-shell modes. The test binary doubles as its own