4.115
Last change
on this file since 9b4422a2 was
9b4422a2,
checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24
|
Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.
+ remove occurrences of two blank comment lines
next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
contain CVS Ids
+ If the processing left a blank line at the top of
a file, it was removed.
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[07a3253d] | 1 | /* |
---|
| 2 | * unmount() - Unmount a File System |
---|
| 3 | * |
---|
[50f32b11] | 4 | * This routine is not defined in the POSIX 1003.1b standard but |
---|
[07a3253d] | 5 | * in some form is supported on most UNIX and POSIX systems. This |
---|
| 6 | * routine is necessary to mount instantiations of a file system |
---|
| 7 | * into the file system name space. |
---|
| 8 | * |
---|
[71c012af] | 9 | * COPYRIGHT (c) 1989-2010. |
---|
[07a3253d] | 10 | * On-Line Applications Research Corporation (OAR). |
---|
| 11 | * |
---|
| 12 | * The license and distribution terms for this file may be |
---|
| 13 | * found in the file LICENSE in this distribution or at |
---|
[0eae36c7] | 14 | * http://www.rtems.com/license/LICENSE. |
---|
[07a3253d] | 15 | */ |
---|
| 16 | |
---|
[9c49db4] | 17 | #if HAVE_CONFIG_H |
---|
[3b7c123] | 18 | #include "config.h" |
---|
[9c49db4] | 19 | #endif |
---|
| 20 | |
---|
[07a3253d] | 21 | #include <errno.h> |
---|
| 22 | |
---|
[3ba74c73] | 23 | #include <rtems/libio_.h> |
---|
[07a3253d] | 24 | |
---|
[3b7c123] | 25 | int unmount( const char *path ) |
---|
[9c30d6a9] | 26 | { |
---|
[3b7c123] | 27 | int rv = 0; |
---|
| 28 | rtems_filesystem_eval_path_context_t ctx; |
---|
[2563410] | 29 | int eval_flags = RTEMS_FS_FOLLOW_LINK; |
---|
[3b7c123] | 30 | const rtems_filesystem_location_info_t *currentloc = |
---|
| 31 | rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); |
---|
| 32 | rtems_filesystem_mount_table_entry_t *mt_entry = currentloc->mt_entry; |
---|
| 33 | |
---|
| 34 | if ( rtems_filesystem_location_is_root( currentloc ) ) { |
---|
| 35 | rv = (*mt_entry->mt_point_node->location.ops->unmount_h)( mt_entry ); |
---|
| 36 | if ( rv == 0 ) { |
---|
| 37 | rtems_filesystem_mt_entry_declare_lock_context( lock_context ); |
---|
| 38 | |
---|
| 39 | rtems_filesystem_mt_entry_lock( lock_context ); |
---|
| 40 | mt_entry->mounted = false; |
---|
| 41 | rtems_filesystem_mt_entry_unlock( lock_context ); |
---|
| 42 | } |
---|
| 43 | } else { |
---|
| 44 | errno = EACCES; |
---|
| 45 | rv = -1; |
---|
[9c30d6a9] | 46 | } |
---|
| 47 | |
---|
[3b7c123] | 48 | rtems_filesystem_eval_path_cleanup( &ctx ); |
---|
[07a3253d] | 49 | |
---|
[3b7c123] | 50 | return rv; |
---|
[07a3253d] | 51 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.