On Thu, Mar 12, 2020 at 1:05 AM Surya prakash Verma <surya.prak...@tataelxsi.co.in.invalid> wrote: > 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.
Perhaps the original author intended "a+" (open for append/update)? However, if the file is never written to, only read from, then "r" is correct. Just for completeness I looked through all other instances of fopen() calls in nuttx and apps. This appears to be the only one with an illegal mode string. Cheers, Nathan