Skip to content

Commit bd22f2f

Browse files
wdfk-progRbb666
authored andcommitted
fix(dfs): align fd API declarations with DFS_USING_POSIX
1 parent 7384a8e commit bd22f2f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

components/dfs/dfs_v1/include/dfs.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ int dfs_init(void);
8181
char *dfs_normalize_path(const char *directory, const char *filename);
8282
const char *dfs_subdir(const char *directory, const char *filename);
8383

84-
int fd_is_open(const char *pathname);
85-
struct dfs_fdtable *dfs_fdtable_get(void);
86-
8784
void dfs_lock(void);
8885
void dfs_unlock(void);
8986

@@ -93,6 +90,8 @@ void dfs_file_unlock(void);
9390
void dfs_fm_lock(void);
9491
void dfs_fm_unlock(void);
9592

93+
void fd_init(struct dfs_file *fd);
94+
9695
#ifdef DFS_USING_POSIX
9796

9897
/* FD APIs */
@@ -104,7 +103,7 @@ int fd_new(void);
104103
struct dfs_file *fd_get(int fd);
105104
void fd_release(int fd);
106105

107-
void fd_init(struct dfs_file *fd);
106+
int fd_is_open(const char *pathname);
108107
int fd_associate(struct dfs_fdtable *fdt, int fd, struct dfs_file *file);
109108
int fd_get_fd_index(struct dfs_file *file);
110109

components/dfs/dfs_v1/src/dfs.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ char working_directory[DFS_PATH_MAX] = {"/"};
3535
#endif
3636

3737
static struct dfs_fdtable _fdtab;
38+
#ifdef DFS_USING_POSIX
3839
static int fd_alloc(struct dfs_fdtable *fdt, int startfd);
40+
#endif /* DFS_USING_POSIX */
3941

4042
/**
4143
* @addtogroup group_device_virtual_file_system
@@ -477,8 +479,6 @@ rt_err_t sys_dup(int oldfd)
477479
return newfd;
478480
}
479481

480-
#endif /* DFS_USING_POSIX */
481-
482482
/**
483483
* @ingroup group_fs_file_descriptor
484484
*
@@ -696,6 +696,7 @@ int fd_associate(struct dfs_fdtable *fdt, int fd, struct dfs_file *file)
696696
dfs_file_unlock();
697697
return retfd;
698698
}
699+
#endif /* DFS_USING_POSIX */
699700

700701
/**
701702
* @brief initialize a dfs file object.
@@ -1082,6 +1083,6 @@ int lsof(int argc, char *argv[])
10821083
MSH_CMD_EXPORT(lsof, list open files);
10831084
#endif /* RT_USING_SMART */
10841085

1085-
#endif
1086+
#endif /* RT_USING_FINSH */
10861087
/**@}*/
10871088

0 commit comments

Comments
 (0)