source: rtems/cpukit/libfs/src/imfs/imfs_dir.c

Last change on this file was 80cf60e, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 15, 2020 at 7:48:32 AM

Canonicalize config.h include

Use the following variant which was already used by most source files:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

  • Property mode set to 100644
File size: 983 bytes
Line 
1/**
2 * @file
3 *
4 * @ingroup IMFS
5 */
6
7/*
8 *  COPYRIGHT (c) 1989-1999.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#ifdef HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#include <rtems/imfs.h>
21
22IMFS_jnode_t *IMFS_node_initialize_directory(
23  IMFS_jnode_t *node,
24  void *arg
25)
26{
27  IMFS_directory_t *dir = (IMFS_directory_t *) node;
28
29  rtems_chain_initialize_empty( &dir->Entries );
30
31  return node;
32}
33
34static bool IMFS_is_mount_point( const IMFS_directory_t *dir )
35{
36  return dir->mt_fs != NULL;
37}
38
39IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node )
40{
41  IMFS_directory_t *dir = (IMFS_directory_t *) node;
42
43  if ( !rtems_chain_is_empty( &dir->Entries ) ) {
44    errno = ENOTEMPTY;
45    dir = NULL;
46  } else if ( IMFS_is_mount_point( dir ) ) {
47    errno = EBUSY;
48    dir = NULL;
49  }
50
51  return &dir->Node;
52}
Note: See TracBrowser for help on using the repository browser.