GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: fx_directory_local_path_clear.c Lines: 6 6 100.0 %
Date: 2024-01-10 21:53:23 Branches: 2 2 100.0 %

Line Branch Exec Source
1
/**************************************************************************/
2
/*                                                                        */
3
/*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4
/*                                                                        */
5
/*       This software is licensed under the Microsoft Software License   */
6
/*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7
/*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8
/*       and in the root directory of this software.                      */
9
/*                                                                        */
10
/**************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** FileX Component                                                       */
17
/**                                                                       */
18
/**   Directory                                                           */
19
/**                                                                       */
20
/**************************************************************************/
21
/**************************************************************************/
22
23
#define FX_SOURCE_CODE
24
25
26
/* Include necessary system files.  */
27
28
#include "fx_api.h"
29
#include "fx_system.h"
30
#include "fx_file.h"
31
#include "fx_utility.h"
32
#include "fx_directory.h"
33
34
#ifndef FX_NO_LOCAL_PATH
35
FX_LOCAL_PATH_SETUP
36
#endif
37
38
39
/**************************************************************************/
40
/*                                                                        */
41
/*  FUNCTION                                               RELEASE        */
42
/*                                                                        */
43
/*    _fx_directory_local_path_clear                      PORTABLE C      */
44
/*                                                           6.1          */
45
/*  AUTHOR                                                                */
46
/*                                                                        */
47
/*    William E. Lamie, Microsoft Corporation                             */
48
/*                                                                        */
49
/*  DESCRIPTION                                                           */
50
/*                                                                        */
51
/*    This function clears the local default directory of the media so    */
52
/*    any path relative operations will start using the media's global    */
53
/*    default path again.                                                 */
54
/*                                                                        */
55
/*  INPUT                                                                 */
56
/*                                                                        */
57
/*    media_ptr                             Media control block pointer   */
58
/*                                                                        */
59
/*  OUTPUT                                                                */
60
/*                                                                        */
61
/*    return status                                                       */
62
/*                                                                        */
63
/*  CALLS                                                                 */
64
/*                                                                        */
65
/*    None                                                                */
66
/*                                                                        */
67
/*  CALLED BY                                                             */
68
/*                                                                        */
69
/*    Application Code                                                    */
70
/*                                                                        */
71
/*  RELEASE HISTORY                                                       */
72
/*                                                                        */
73
/*    DATE              NAME                      DESCRIPTION             */
74
/*                                                                        */
75
/*  05-19-2020     William E. Lamie         Initial Version 6.0           */
76
/*  09-30-2020     William E. Lamie         Modified comment(s),          */
77
/*                                            resulting in version 6.1    */
78
/*                                                                        */
79
/**************************************************************************/
80
76
UINT  _fx_directory_local_path_clear(FX_MEDIA *media_ptr)
81
{
82
83
84
#ifndef FX_MEDIA_STATISTICS_DISABLE
85
86
    /* Increment the number of times this service has been called.  */
87
76
    media_ptr -> fx_media_directory_local_path_clears++;
88
#endif
89
90
    /* Check the media to make sure it is open.  */
91
76
    if (media_ptr -> fx_media_id != FX_MEDIA_ID)
92
    {
93
94
        /* Return the media not opened error.  */
95
1
        return(FX_MEDIA_NOT_OPEN);
96
    }
97
98
#ifdef FX_NO_LOCAL_PATH
99
100
    /* Error, return to caller.  */
101
    return(FX_NOT_IMPLEMENTED);
102
#else
103
104
    /* If trace is enabled, insert this event into the trace buffer.  */
105
    FX_TRACE_IN_LINE_INSERT(FX_TRACE_DIRECTORY_LOCAL_PATH_CLEAR, media_ptr, 0, 0, 0, FX_TRACE_DIRECTORY_EVENTS, 0, 0)
106
107
    /* Clear this thread's local path pointer.  */
108
75
    _tx_thread_current_ptr -> tx_thread_filex_ptr =  FX_NULL;
109
110
    /* Local default directory clear is complete, return status.  */
111
75
    return(FX_SUCCESS);
112
#endif
113
}
114