patacongo commented on a change in pull request #558: 
libs/libc/netdb/lib_dnsaddserver.c: Fix wrong fopen() mode.
URL: https://github.com/apache/incubator-nuttx/pull/558#discussion_r392524223
 
 

 ##########
 File path: libs/libc/netdb/lib_dnsaddserver.c
 ##########
 @@ -87,7 +87,7 @@ int dns_add_nameserver(FAR const struct sockaddr *addr, 
socklen_t addrlen)
   int status;
   int ret;
 
-  stream = fopen(CONFIG_NETDB_RESOLVCONF_PATH, "at");
+  stream = fopen(CONFIG_NETDB_RESOLVCONF_PATH, "r");
 
 Review comment:
   > But if you read the whole function carefully, you can find 
dns_add_nameserver don't has any other real action if the file can't write.
   
   From the little reading I have done, that does not seem exactly true:
   
   - If DHCP is used the, yes, /etc/resolve/conf may be updated.  In this case, 
resolv.conf would need to be on writable media.  But updates to resovle.conf 
from DHCP is not supported by our implementation of DHCP.
   - On static IP configurations without DHCP, resolve.conf is not modified by 
the system, and hence would be effectly read-only.
   
   Or am I reading that wrong.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to