Skip to content

Commit 00a8818

Browse files
cfriedtkartben
authored andcommitted
posix: options: fs: move posix_fs_desc to fs_priv.h
Move struct posix_fs_desc to fs_priv.h Signed-off-by: Chris Friedt <[email protected]>
1 parent e967120 commit 00a8818

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

lib/posix/options/fs.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
#undef _POSIX_C_SOURCE
88
#define _POSIX_C_SOURCE 200809L
9+
10+
#include "fs_priv.h"
11+
912
#include <errno.h>
1013
#include <zephyr/kernel.h>
1114
#include <limits.h>
@@ -21,15 +24,6 @@ int zvfs_fstat(int fd, struct stat *buf);
2124

2225
BUILD_ASSERT(PATH_MAX >= MAX_FILE_NAME, "PATH_MAX is less than MAX_FILE_NAME");
2326

24-
struct posix_fs_desc {
25-
union {
26-
struct fs_file_t file;
27-
struct fs_dir_t dir;
28-
};
29-
bool is_dir;
30-
bool used;
31-
};
32-
3327
static struct posix_fs_desc desc_array[CONFIG_POSIX_OPEN_MAX];
3428

3529
static struct fs_dirent fdirent;

lib/posix/options/fs_priv.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2018 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef ZEPHYR_LIB_POSIX_OPTIONS_FS_PRIV_H_
8+
#define ZEPHYR_LIB_POSIX_OPTIONS_FS_PRIV_H_
9+
10+
#include <stdbool.h>
11+
12+
#include <zephyr/fs/fs.h>
13+
14+
struct posix_fs_desc {
15+
union {
16+
struct fs_file_t file;
17+
struct fs_dir_t dir;
18+
};
19+
bool is_dir: 1;
20+
bool used: 1;
21+
};
22+
23+
#endif

0 commit comments

Comments
 (0)