pwdgrp.c: Remove _Assert. /etc may already exist

Removed the _Assert_unused_variable_equals macro due to /etc
having already been created by the network stack initialization
or an initial filesystem image.

Closes #4282
This commit is contained in:
Ryan Long
2021-03-23 12:25:15 -04:00
committed by Joel Sherrill
parent 1343fb5f01
commit 37fc6516d3

View File

@@ -67,9 +67,13 @@ static void pwdgrp_init(void)
/*
* Do the best to create this directory.
*
* /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_Unused_variable_equals(sc, 0);
_Assert((sc == 0) || (sc == -1 && errno == EEXIST));
(void) sc;
/*
* Initialize /etc/passwd