[PATCH 5/7] net: wget: make wget_with_dns return value compatible with its lwip version

Adriano Cordova adrianox at gmail.com
Wed Nov 6 14:04:11 CET 2024


There are two wget_with_dns functions, one in the legacy network
stack and one in lwip, but the return values are not compatible.
This commit modifies the legacy version of wget_with_dns so that
the return values are compatible: 0 on success, otherwise a negative
error. This way wget_with_dns can be called in a network stack
agnostic way.

Signed-off-by: Adriano Cordova <adrianox at gmail.com>
---
 net/wget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wget.c b/net/wget.c
index 24be0a4932..6cf721070b 100644
--- a/net/wget.c
+++ b/net/wget.c
@@ -576,7 +576,7 @@ int wget_with_dns(ulong dst_addr, char *uri)
 out:
 	free(str_copy);
 
-	return ret;
+	return ret < 0 ? ret : 0;
 }
 #endif
 
-- 
2.43.0



More information about the U-Boot mailing list