diff options
| author | Meco Man <[email protected]> | 2022-12-26 01:41:10 -0500 |
|---|---|---|
| committer | Man, Jianting (Meco) <[email protected]> | 2023-01-02 15:01:20 -0500 |
| commit | e97ba95f71bd080be62ed9a389b2239f2578ec6f (patch) | |
| tree | 0f682557100b0fa4c0c18a44bdce3164106b087f /components | |
| parent | 431579a166ad4ee1df10a44a0c7a6c7bcbe129d2 (diff) | |
[libc][unistd.h] define F_OK
Diffstat (limited to 'components')
| -rw-r--r-- | components/libc/compilers/common/include/sys/unistd.h | 5 | ||||
| -rw-r--r-- | components/utilities/ulog/backend/file_be.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/components/libc/compilers/common/include/sys/unistd.h b/components/libc/compilers/common/include/sys/unistd.h index 0eaf52423c..b9c64f3bb6 100644 --- a/components/libc/compilers/common/include/sys/unistd.h +++ b/components/libc/compilers/common/include/sys/unistd.h @@ -23,6 +23,11 @@ extern "C" { #define STDOUT_FILENO 1 /* standard output file descriptor */ #define STDERR_FILENO 2 /* standard error file descriptor */ +#define F_OK 0 +#define X_OK 1 +#define W_OK 2 +#define R_OK 4 + unsigned alarm(unsigned __secs); ssize_t read(int fd, void *buf, size_t len); ssize_t write(int fd, const void *buf, size_t len); diff --git a/components/utilities/ulog/backend/file_be.c b/components/utilities/ulog/backend/file_be.c index 62f3f7ad83..a57f2c82a7 100644 --- a/components/utilities/ulog/backend/file_be.c +++ b/components/utilities/ulog/backend/file_be.c @@ -86,7 +86,7 @@ static void ulog_file_backend_flush_with_buf(struct ulog_backend *backend) if (be->cur_log_file_fd < 0) { /* check log file directory */ - if (access(be->cur_log_dir_path, 0) < 0) + if (access(be->cur_log_dir_path, F_OK) < 0) { mkdir(be->cur_log_dir_path, 0); } |
