I am trying to test DNS Name resolution but observed issue of file opening
fails while running.
After debugging we have observed fails at following code:
stream = fopen(CONFIG_NETDB_RESOLVCONF_PATH, "at"); in
libs/libc/netdb/lib_dnsaddserver.c.
We have analyzed the issue and observed trying to open resolv.conf in "at" mode but
There is no such mode as "at" in C programming.
So We have experimented with "a+" "w+" etc but these did not work because of the
"resolv.conf" file resides in /etc directory in ROMFS,
ROMFS supports only "r" mode.
So modified the code as mentioned below.
stream = fopen(CONFIG_NETDB_RESOLVCONF_PATH, "at"); must be changed to
stream = fopen(CONFIG_NETDB_RESOLVCONF_PATH, "r");
With this change it is working properly.
Kindly confirm our understanding.
That seems like a correct analysis. Can you please submit a PR to
https://github.com/apache/incubator-nuttx ?