pwdgrp.c: Change to simply ignore return value from mkdir(/etc)

At this point in time, /etc can be created in multiple ways. There
is a discussion (#4354) that would define a mechanism for
instantiating a base file system with some flexibility for the
set of directories included. For now, this particular mkdir()
call can fail because /etc could already have been created by
at least an initial filesystem image, the shell, or libbsd.

closes #4382.
This commit is contained in:
Joel Sherrill
2021-03-27 09:55:49 -05:00
parent fd639b8abf
commit d4d2f6487a

View File

@@ -71,9 +71,7 @@ static void pwdgrp_init(void)
* /etc could be created by the network stack initialization or an initial
* filesystem image. Deliberately ignore the return value.
*/
sc = mkdir("/etc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
_Assert((sc == 0) || (sc == -1 && errno == EEXIST));
(void) sc;
(void) mkdir("/etc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
/*
* Initialize /etc/passwd