You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/09/27 04:20:33 UTC

[incubator-nuttx-apps] 03/03: netutls/dhcpc: treat EINTR as normal errno

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

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

commit 09dfbdf4c7c1428cfc587dcd48bbd645b15d588d
Author: chao an <an...@xiaomi.com>
AuthorDate: Tue Sep 27 03:12:15 2022 +0800

    netutls/dhcpc: treat EINTR as normal errno
    
    A return code of EINTR is perfectly normal, and isn't an error as such.
    It's an indication that your program may need to do something because
    a signal occurred, but if not, should re-call recv().
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 netutils/dhcpc/dhcpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c
index 3ec6c4af6..43c2edc48 100644
--- a/netutils/dhcpc/dhcpc.c
+++ b/netutils/dhcpc/dhcpc.c
@@ -765,7 +765,7 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
            * of time). Then loop and send the DISCOVER command again.
            */
 
-          else if (errno != EAGAIN)
+          else if (errno != EAGAIN && errno != EINTR)
             {
               /* An error other than a timeout was received -- error out */
 
@@ -865,7 +865,7 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
            * (at most 3 times).
            */
 
-          else if (errno != EAGAIN)
+          else if (errno != EAGAIN && errno != EINTR)
             {
               /* An error other than a timeout was received */