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

Joel Sherrill joel at rtems.org
Sat Mar 27 14:59:31 UTC 2021


Module:    rtems
Branch:    master
Commit:    d4d2f6487ac4db85746ee208c6f7a23105ed5444
Changeset: http://git.rtems.org/rtems/commit/?id=d4d2f6487ac4db85746ee208c6f7a23105ed5444

Author:    Joel Sherrill <joel at rtems.org>
Date:      Sat Mar 27 09:55:49 2021 -0500

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.

---

 cpukit/libcsupport/src/pwdgrp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cpukit/libcsupport/src/pwdgrp.c b/cpukit/libcsupport/src/pwdgrp.c
index 154a92a..aac31f4 100644
--- a/cpukit/libcsupport/src/pwdgrp.c
+++ b/cpukit/libcsupport/src/pwdgrp.c
@@ -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



More information about the vc mailing list