<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-06-08)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-08 Sebastian Huber <sebastian.huber@embedded-brains.de>

        PR 1524/filesystem
        * libcsupport/src/rtems_mkdir.c: New file.
        * libcsupport/src/Makefile.am: Reflect change above.
        * libcsupport/include/rtems/libio.h: Added rtems_mkdir().
        * libmisc/fsmount/fsmount.h, libmisc/fsmount/fsmount.c,
        libblock/src/bdpart-mount.c, libnetworking/rtems/mkrootfs.h,
        libnetworking/rtems/mkrootfs.c, libfs/src/pipe/pipe.c: Use
        rtems_mkdir().  Removed rtems_fsmount_create_mount_point() and
        rtems_rootfs_mkdir().
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2354&r2=text&tr2=1.2355&diff_format=h">M</a></td><td width='1%'>1.2355</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libblock/src/bdpart-mount.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>cpukit/libblock/src/bdpart-mount.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/Makefile.am.diff?r1=text&tr1=1.119&r2=text&tr2=1.120&diff_format=h">M</a></td><td width='1%'>1.120</td><td width='100%'>cpukit/libcsupport/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/include/rtems/libio.h.diff?r1=text&tr1=1.66&r2=text&tr2=1.67&diff_format=h">M</a></td><td width='1%'>1.67</td><td width='100%'>cpukit/libcsupport/include/rtems/libio.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/rtems_mkdir.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/libcsupport/src/rtems_mkdir.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/pipe/pipe.c.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&diff_format=h">M</a></td><td width='1%'>1.6</td><td width='100%'>cpukit/libfs/src/pipe/pipe.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/fsmount/fsmount.h.diff?r1=text&tr1=1.7&r2=text&tr2=1.8&diff_format=h">M</a></td><td width='1%'>1.8</td><td width='100%'>cpukit/libmisc/fsmount/fsmount.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/fsmount/fsmount.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>cpukit/libmisc/fsmount/fsmount.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libnetworking/rtems/mkrootfs.h.diff?r1=text&tr1=1.8&r2=text&tr2=1.9&diff_format=h">M</a></td><td width='1%'>1.9</td><td width='100%'>cpukit/libnetworking/rtems/mkrootfs.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libnetworking/rtems/mkrootfs.c.diff?r1=text&tr1=1.11&r2=text&tr2=1.12&diff_format=h">M</a></td><td width='1%'>1.12</td><td width='100%'>cpukit/libnetworking/rtems/mkrootfs.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2354 rtems/cpukit/ChangeLog:1.2355
--- rtems/cpukit/ChangeLog:1.2354       Tue Jun  8 05:25:36 2010
+++ rtems/cpukit/ChangeLog      Tue Jun  8 07:59:50 2010
</font><font color='#997700'>@@ -1,5 +1,17 @@
</font> 2010-06-08        Sebastian Huber <sebastian.huber@embedded-brains.de>
 
<font color='#000088'>+   PR 1524/filesystem
+       * libcsupport/src/rtems_mkdir.c: New file.
+       * libcsupport/src/Makefile.am: Reflect change above.
+       * libcsupport/include/rtems/libio.h: Added rtems_mkdir().
+       * libmisc/fsmount/fsmount.h, libmisc/fsmount/fsmount.c,
+       libblock/src/bdpart-mount.c, libnetworking/rtems/mkrootfs.h,
+       libnetworking/rtems/mkrootfs.c, libfs/src/pipe/pipe.c: Use
+       rtems_mkdir().  Removed rtems_fsmount_create_mount_point() and
+       rtems_rootfs_mkdir().
+
+2010-06-08     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
</font>   * libfs/src/imfs/fifoimfs_init.c: New file.
        * libfs/Makefile.am: Reflect change above.
        * libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_eval.c,

<font color='#006600'>diff -u rtems/cpukit/libblock/src/bdpart-mount.c:1.2 rtems/cpukit/libblock/src/bdpart-mount.c:1.3
--- rtems/cpukit/libblock/src/bdpart-mount.c:1.2        Mon May 31 08:56:36 2010
+++ rtems/cpukit/libblock/src/bdpart-mount.c    Tue Jun  8 07:59:51 2010
</font><font color='#997700'>@@ -29,7 +29,7 @@
</font> 
 #include <rtems.h>
 #include <rtems/bdpart.h>
<font color='#880000'>-#include <rtems/fsmount.h>
</font><font color='#000088'>+#include <rtems/libio.h>
</font> 
 rtems_status_code rtems_bdpart_mount(
   const char *disk_name,
<font color='#997700'>@@ -90,7 +90,7 @@
</font> 
     /* Create mount point */
     strncpy( mount_marker, logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE);
<font color='#880000'>-    rv = rtems_fsmount_create_mount_point( mount_point);
</font><font color='#000088'>+    rv = rtems_mkdir( mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
</font>     if (rv != 0) {
       esc = RTEMS_IO_ERROR;
       goto cleanup;

<font color='#006600'>diff -u rtems/cpukit/libcsupport/Makefile.am:1.119 rtems/cpukit/libcsupport/Makefile.am:1.120
--- rtems/cpukit/libcsupport/Makefile.am:1.119  Mon Jun  7 09:57:31 2010
+++ rtems/cpukit/libcsupport/Makefile.am        Tue Jun  8 07:59:51 2010
</font><font color='#997700'>@@ -46,7 +46,7 @@
</font> BASE_FS_C_FILES = src/base_fs.c src/mount.c src/unmount.c src/libio.c \
     src/mount-mgr.c src/libio_init.c \
     src/libio_sockets.c src/eval.c src/fs_null_handlers.c src/privateenv.c \
<font color='#880000'>-    src/open_dev_console.c src/__usrenv.c
</font><font color='#000088'>+    src/open_dev_console.c src/__usrenv.c src/rtems_mkdir.c
</font> 
 TERMIOS_C_FILES = src/cfgetispeed.c src/cfgetospeed.c src/cfsetispeed.c \
     src/cfsetospeed.c src/tcgetattr.c src/tcsetattr.c src/tcdrain.c \

<font color='#006600'>diff -u rtems/cpukit/libcsupport/include/rtems/libio.h:1.66 rtems/cpukit/libcsupport/include/rtems/libio.h:1.67
--- rtems/cpukit/libcsupport/include/rtems/libio.h:1.66 Mon Jun  7 10:35:24 2010
+++ rtems/cpukit/libcsupport/include/rtems/libio.h      Tue Jun  8 07:59:51 2010
</font><font color='#997700'>@@ -735,6 +735,17 @@
</font> typedef void (*rtems_fs_init_functions_t)(void);
 extern  rtems_fs_init_functions_t    rtems_fs_init_helper;
 
<font color='#000088'>+/**
+ * @brief Creates a directory and all its parrent directories according to
+ * @a path.
+ *
+ * The @a mode value selects the access permissions of the directory.
+ *
+ * @retval 0 Successful operation.
+ * @retval -1 An error occured.  @c errno indicates the error.
+ */
+extern int rtems_mkdir(const char *path, mode_t mode);
+
</font> #ifdef __cplusplus
 }
 #endif

<font color='#006600'>diff -u /dev/null rtems/cpukit/libcsupport/src/rtems_mkdir.c:1.1
--- /dev/null   Tue Jun  8 08:11:19 2010
+++ rtems/cpukit/libcsupport/src/rtems_mkdir.c  Tue Jun  8 08:05:11 2010
</font><font color='#997700'>@@ -0,0 +1,141 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup LibIO
+ *
+ * @brief rtems_mkdir() implementation.
+ *
+ * The implementation is based on FreeBSD 'bin/mkdir/mkdir.c' revision 163213.
+ */
+
+/*-
+ * Copyright (c) 2010 embedded brains GmbH.
+ *
+ * Copyright (c) 1983, 1992, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rtems/libio.h>
+
+/*
+ * Returns 1 if a directory has been created,
+ * 2 if it already existed, and 0 on failure.
+ */
+static int
+build(char *path, mode_t omode)
+{
+       struct stat sb;
+       mode_t numask, oumask;
+       int first, last, retval;
+       char *p;
+
+       p = path;
+       oumask = 0;
+       retval = 1;
+       if (p[0] == '/')                /* Skip leading '/'. */
+               ++p;
+       for (first = 1, last = 0; !last ; ++p) {
+               if (p[0] == '\0')
+                       last = 1;
+               else if (p[0] != '/')
+                       continue;
+               *p = '\0';
+               if (!last && p[1] == '\0')
+                       last = 1;
+               if (first) {
+                       /*
+                        * POSIX 1003.2:
+                        * For each dir operand that does not name an existing
+                        * directory, effects equivalent to those caused by the
+                        * following command shall occcur:
+                        *
+                        * mkdir -p -m $(umask -S),u+wx $(dirname dir) &&
+                        *    mkdir [-m mode] dir
+                        *
+                        * We change the user's umask and then restore it,
+                        * instead of doing chmod's.
+                        */
+                       oumask = umask(0);
+                       numask = oumask & ~(S_IWUSR | S_IXUSR);
+                       (void)umask(numask);
+                       first = 0;
+               }
+               if (last)
+                       (void)umask(oumask);
+               if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
+                       if (errno == EEXIST || errno == EISDIR) {
+                               if (stat(path, &sb) < 0) {
+                                       retval = 0;
+                                       break;
+                               } else if (!S_ISDIR(sb.st_mode)) {
+                                       if (last)
+                                               errno = EEXIST;
+                                       else
+                                               errno = ENOTDIR;
+                                       retval = 0;
+                                       break;
+                               }
+                               if (last)
+                                       retval = 2;
+                       } else {
+                               retval = 0;
+                               break;
+                       }
+               }
+               if (!last)
+                   *p = '/';
+       }
+       if (!first && !last)
+               (void)umask(oumask);
+       return (retval);
+}
+
+int
+rtems_mkdir(const char *path, mode_t mode)
+{
+       int success = 0;
+       char *dup_path = strdup(path);
+
+       if (dup_path != NULL) {
+               success = build(dup_path, mode);
+               free(dup_path);
+       }
+
+       return success != 0 ? 0 : -1;
+}
</font>
<font color='#006600'>diff -u rtems/cpukit/libfs/src/pipe/pipe.c:1.5 rtems/cpukit/libfs/src/pipe/pipe.c:1.6
--- rtems/cpukit/libfs/src/pipe/pipe.c:1.5      Tue Jun  8 05:25:46 2010
+++ rtems/cpukit/libfs/src/pipe/pipe.c  Tue Jun  8 07:59:51 2010
</font><font color='#997700'>@@ -30,20 +30,11 @@
</font>   int filsdes[2]
 )
 {
<font color='#880000'>-  rtems_filesystem_location_info_t loc;
</font>   rtems_libio_t *iop;
   int err = 0;
<font color='#880000'>-  /* Create /tmp if not exists */
-  /* FIXME: We should use a general mkdir function for this */
-  if (rtems_filesystem_evaluate_path("/tmp", 3, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE)
-      != 0) {
-    if (errno != ENOENT)
-      return -1;
-    if (mkdir("/tmp", S_IRWXU|S_IRWXG|S_IRWXO|S_ISVTX) != 0)
-      return -1;
-  }
-  else
-    rtems_filesystem_freenode(&loc);
</font><font color='#000088'>+
+  if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
+    return -1;
</font> 
   /* /tmp/.fifoXXXX */
   char fifopath[15];

<font color='#006600'>diff -u rtems/cpukit/libmisc/fsmount/fsmount.h:1.7 rtems/cpukit/libmisc/fsmount/fsmount.h:1.8
--- rtems/cpukit/libmisc/fsmount/fsmount.h:1.7  Mon May 31 08:56:37 2010
+++ rtems/cpukit/libmisc/fsmount/fsmount.h      Tue Jun  8 07:59:51 2010
</font><font color='#997700'>@@ -121,24 +121,14 @@
</font> } rtems_fstab_entry;
 
 /**
<font color='#880000'>- * Creates the mount point with path @a mount_point.
- *
- * On success, zero is returned.  On error, -1 is returned, and @c errno is set
- * appropriately.
- *
- * @see rtems_fsmount().
- */
-int rtems_fsmount_create_mount_point(const char *mount_point);
-
-/**
</font>  * Mounts the file systems listed in the file system mount table @a fstab of
  * size @a size.
  *
  * Each file system will be mounted according to its table entry parameters.
  * In case of an abort condition the corresponding table index will be reported
  * in @a abort_index.  The pointer @a abort_index may be @c NULL.  The mount
<font color='#880000'>- * point paths will be created with rtems_fsmount_create_mount_point() and need
- * not exist beforehand.
</font><font color='#000088'>+ * point paths will be created with rtems_mkdir() and need not exist
+ * beforehand.
</font>  *
  * On success, zero is returned.  On error, -1 is returned, and @c errno is set
  * appropriately.

<font color='#006600'>diff -u rtems/cpukit/libmisc/fsmount/fsmount.c:1.12 rtems/cpukit/libmisc/fsmount/fsmount.c:1.13
--- rtems/cpukit/libmisc/fsmount/fsmount.c:1.12 Mon May 31 08:56:37 2010
+++ rtems/cpukit/libmisc/fsmount/fsmount.c      Tue Jun  8 07:59:51 2010
</font><font color='#997700'>@@ -34,83 +34,11 @@
</font> 
 #include <rtems.h>
 #include <rtems/fsmount.h>
<font color='#000088'>+#include <rtems/libio.h>
</font> #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
<font color='#880000'>-#include <rtems/imfs.h>
-#include <sys/stat.h>
-
-/*=========================================================================*\
-| Function:                                                                 |
-\*-------------------------------------------------------------------------*/
-int rtems_fsmount_create_mount_point
-(
-/*-------------------------------------------------------------------------*\
-| Purpose:                                                                  |
-|  This function will create the mount point given                          |
-+---------------------------------------------------------------------------+
-| Input Parameters:                                                         |
-\*-------------------------------------------------------------------------*/
- const char *mount_point
- )
-/*-------------------------------------------------------------------------*\
-| Return Value:                                                             |
-|    0, if success, -1 and errno if failed                                  |
-\*=========================================================================*/
-{
-  int rc = 0;
-  char *tok_buffer = NULL;
-  char *token = NULL;
-  int    token_len;
-  size_t total_len;
-  IMFS_token_types token_type;
-  struct stat file_info;
-  /*
-   * allocate temp memory to rebuild path name
-   */
-  tok_buffer = calloc(strlen(mount_point)+1,sizeof(char));
-  if ( !tok_buffer )
-    return -1;
-  token = tok_buffer;
-  total_len = 0;
-  do {
-    /*
-     * scan through given string, one segment at a time
-     */
-    token_type = IMFS_get_token(
-      mount_point+total_len,
-      strlen(mount_point+total_len),
-      token,
-      &token_len
-    );
-    total_len += token_len;
-    strncpy(tok_buffer,mount_point,total_len);
-    tok_buffer[total_len] = '\0';
-
-    if ((token_type != IMFS_NO_MORE_PATH) &&
-       (token_type != IMFS_CURRENT_DIR)  &&
-       (token_type != IMFS_INVALID_TOKEN)) {
-      /*
-       * check, whether segment exists
-       */
-      if (0 != stat(tok_buffer,&file_info)) {
-       /*
-        * if not, create directory
-        */
-       rc = mknod(tok_buffer,S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR,0);
-      }
-    }
-  } while ((rc == 0) &&
-          (token_type != IMFS_NO_MORE_PATH) &&
-          (token_type != IMFS_INVALID_TOKEN));
-
-  /*
-   * return token buffer to heap. Verified to be non-NULL when calloc'ed.
-   */
-  free(tok_buffer);
-  return rc;
-}
</font> 
 /*=========================================================================*\
 | Function:                                                                 |
<font color='#997700'>@@ -148,7 +76,7 @@
</font>      * create mount point
      */
     if (tmp_rc == 0) {
<font color='#880000'>-      tmp_rc = rtems_fsmount_create_mount_point(fstab_ptr->target);
</font><font color='#000088'>+      tmp_rc = rtems_mkdir(fstab_ptr->target, S_IRWXU | S_IRWXG | S_IRWXO);
</font>       if (tmp_rc != 0) {
         if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNTPNT_CRTERR)) {
           fprintf(stdout,"fsmount: creation of mount point \"%s\" failed: %s\n",

<font color='#006600'>diff -u rtems/cpukit/libnetworking/rtems/mkrootfs.h:1.8 rtems/cpukit/libnetworking/rtems/mkrootfs.h:1.9
--- rtems/cpukit/libnetworking/rtems/mkrootfs.h:1.8     Fri Aug  1 00:07:41 2008
+++ rtems/cpukit/libnetworking/rtems/mkrootfs.h Tue Jun  8 07:59:51 2010
</font><font color='#997700'>@@ -31,13 +31,6 @@
</font> #include <rtems.h>
 
 /*
<font color='#880000'>- *  Builds the complete path, like "mkdir -p".
- */
-
-int
-rtems_rootfs_mkdir (const char *path, mode_t omode);
-
-/*
</font>  *  Appends the lines to the a file. Create the file
  *  and builds the path if it does not exist.
  */

<font color='#006600'>diff -u rtems/cpukit/libnetworking/rtems/mkrootfs.c:1.11 rtems/cpukit/libnetworking/rtems/mkrootfs.c:1.12
--- rtems/cpukit/libnetworking/rtems/mkrootfs.c:1.11    Sun Jan 31 18:03:01 2010
+++ rtems/cpukit/libnetworking/rtems/mkrootfs.c Tue Jun  8 07:59:51 2010
</font><font color='#997700'>@@ -68,96 +68,6 @@
</font> #define MKDIR_MODE  (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
 
 /*
<font color='#880000'>- * Build a path. Taken from the BSD `mkdir' command.
- */
-
-int
-rtems_rootfs_mkdir (const char *path_orig, mode_t omode)
-{
-  struct stat sb;
-  mode_t      numask, oumask;
-  int         first, last, retval;
-  char        path[128];
-  char        *p = path;
-
-  if (strlen (path_orig) >= sizeof path)
-  {
-    printf ("root fs: mkdir path too long `%s'\n", path);
-    return -1;
-  }
-
-  strcpy (path, path_orig);
-  oumask = 0;
-  retval = 0;
-  if (p[0] == '/')    /* Skip leading '/'. */
-    ++p;
-  for (first = 1, last = 0; !last ; ++p)
-  {
-    if (p[0] == '\0')
-      last = 1;
-    else if (p[0] != '/')
-      continue;
-    *p = '\0';
-    if (p[1] == '\0')
-      last = 1;
-    if (first)
-    {
-      /*
-       * POSIX 1003.2:
-       * For each dir operand that does not name an existing
-       * directory, effects equivalent to those cased by the
-       * following command shall occcur:
-       *
-       * mkdir -p -m $(umask -S),u+wx $(dirname dir) &&
-       *    mkdir [-m mode] dir
-       *
-       * We change the user's umask and then restore it,
-       * instead of doing chmod's.
-       */
-      oumask = umask(0);
-      numask = oumask & ~(S_IWUSR | S_IXUSR);
-      umask(numask);
-      first = 0;
-    }
-    if (last)
-      umask(oumask);
-    if (stat(path, &sb))
-    {
-      if (errno != ENOENT)
-      {
-        printf ("root fs: error stat'ing path `%s', %s\n",
-                path, strerror (errno));
-        retval = 1;
-        break;
-      }
-      if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0)
-      {
-        printf ("root fs: error building path `%s', %s\n",
-                path, strerror (errno));
-        retval = 1;
-        break;
-      }
-    }
-    else if ((sb.st_mode & S_IFMT) != S_IFDIR)
-    {
-      if (last)
-        errno = EEXIST;
-      else
-        errno = ENOTDIR;
-      printf ("root fs: path `%s' contains a file, %s\n",
-              path, strerror (errno));
-      retval = 1;
-      break;
-    }
-    if (!last)
-      *p = '/';
-  }
-  if (!first && !last)
-    umask(oumask);
-  return retval;
-}
-
-/*
</font>  * Create enough files to support the networking stack.
  * Points to a table of strings.
  */
<font color='#997700'>@@ -205,7 +115,7 @@
</font>           strncpy (path, file, i);
           path[i] = '\0';
 
<font color='#880000'>-          if (rtems_rootfs_mkdir (path, MKDIR_MODE))
</font><font color='#000088'>+          if (rtems_mkdir (path, MKDIR_MODE))
</font>             return -1;
           break;
         }
<font color='#997700'>@@ -310,7 +220,7 @@
</font>   for (i = 0;
        i < (sizeof (default_directories) / sizeof (rtems_rootfs_dir_table));
        i++)
<font color='#880000'>-    if (rtems_rootfs_mkdir (default_directories[i].name,
</font><font color='#000088'>+    if (rtems_mkdir (default_directories[i].name,
</font>                             default_directories[i].mode))
       return -1;
 
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>