[libc][unistd.h] define F_OK
This commit is contained in:
parent
431579a166
commit
e97ba95f71
|
@ -23,6 +23,11 @@ extern "C" {
|
||||||
#define STDOUT_FILENO 1 /* standard output file descriptor */
|
#define STDOUT_FILENO 1 /* standard output file descriptor */
|
||||||
#define STDERR_FILENO 2 /* standard error 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);
|
unsigned alarm(unsigned __secs);
|
||||||
ssize_t read(int fd, void *buf, size_t len);
|
ssize_t read(int fd, void *buf, size_t len);
|
||||||
ssize_t write(int fd, const void *buf, size_t len);
|
ssize_t write(int fd, const void *buf, size_t len);
|
||||||
|
|
|
@ -86,7 +86,7 @@ static void ulog_file_backend_flush_with_buf(struct ulog_backend *backend)
|
||||||
if (be->cur_log_file_fd < 0)
|
if (be->cur_log_file_fd < 0)
|
||||||
{
|
{
|
||||||
/* check log file directory */
|
/* 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);
|
mkdir(be->cur_log_dir_path, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue