[rtems commit] Don't fail to create passwd and group files if / etc already exists

Sebastian Huber sebh at rtems.org
Fri Feb 20 07:57:26 UTC 2015


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

Author:    Nick Withers <nick.withers at anu.edu.au>
Date:      Fri Feb 20 15:00:47 2015 +1100

Don't fail to create passwd and group files if /etc already exists

---

 cpukit/libcsupport/src/pwdgrp.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/cpukit/libcsupport/src/pwdgrp.c b/cpukit/libcsupport/src/pwdgrp.c
index a5526a0..b184ea8 100644
--- a/cpukit/libcsupport/src/pwdgrp.c
+++ b/cpukit/libcsupport/src/pwdgrp.c
@@ -61,11 +61,10 @@ static void init_file(const char *name, const char *content)
  */
 static void pwdgrp_init(void)
 {
-  int rc;
-
-  rc = mkdir("/etc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
-  if ( rc != 0 )
-    return;
+  /*
+   * Do the best to create this directory.
+   */
+  mkdir("/etc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
 
   /*
    *  Initialize /etc/passwd




More information about the vc mailing list