On Thu, Feb 7, 2019 at 11:26 AM Brian Ledbetter <[email protected]> wrote:
> > > On Thursday, February 7, 2019 at 4:11:14 AM UTC-5, Nadav Har'El wrote: > >> Why is it possible that /etc doesn't exist yet? I think we start DHCP >> *after* mounting the root filesystem. >> > > I'm overly cautious by nature and entirely unsure whether /etc is a > standard OSv directory or not. > We already put other thins in /etc (see usr.manifest.skel - we put /etc/fstab, /etc/mnttab, /etc/hosts, because other applications needed them), so unless we do things in the wrong order (run DHCP first and only then mount / and /etc, etc.), /etc should be there. You can of course try to run this and see if it works for you. > > Why "w+"? "w+" is for when you will also need to read from the same file. >> Here you just plan to truncate and write to it. >> So a normal "w" is exactly what you need. >> > > Good point, I forgot that + means "write" instead of "create if doesn't > exist." Can also convert this to an open() call if that fits better with > OSv's preferred code paths. > No, stdio (fopen, fprintf, etc.) are perfectly fine. > > Thanks so much for the feedback, I'm off to revise the patches now! > > -- > You received this message because you are subscribed to the Google Groups > "OSv Development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
