This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 1e814e0ec3f5dc7c70d71370a3df0025a445a2ac
Author: wangchen <[email protected]>
AuthorDate: Tue Nov 11 21:09:36 2025 +0800

    netutils/netlib: log getifstatistics failures with nerr().
    
    netlib_getifstatistics() wrote an error to stderr when it could not open
    the procfs statistics file.  Callers that own stdout/stderr for a
    transfer protocol (ymodem, for example) received that text as protocol
    data and the transfer failed.  Report the error through nerr() instead;
    the -ENOTDIR return value already tells the caller what went wrong.
    
    Signed-off-by: wangchen <[email protected]>
    Assisted-by: Kiro:claude-opus-4
---
 netutils/netlib/netlib_getifstatistics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/netutils/netlib/netlib_getifstatistics.c 
b/netutils/netlib/netlib_getifstatistics.c
index e6c52abba..1766fa64a 100644
--- a/netutils/netlib/netlib_getifstatistics.c
+++ b/netutils/netlib/netlib_getifstatistics.c
@@ -96,7 +96,7 @@ int netlib_getifstatistics(FAR const char *ifname,
   stream = fopen(path, "r");
   if (stream == NULL)
     {
-      fprintf(stderr, "ERROR: Failed to open path:%s \n", path);
+      nerr("ERROR: Failed to open path:%s \n", path);
       return -ENOTDIR;
     }
 

Reply via email to