Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ReyunSecureSdk
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
daiwenjie
ReyunSecureSdk
Commits
89da278b
Commit
89da278b
authored
Apr 16, 2021
by
Fear1ess
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4/8
parent
a907e0e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
utils.c
wandun/src/main/cpp/utils.c
+6
-8
No files found.
wandun/src/main/cpp/utils.c
View file @
89da278b
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#include "wd_syscall.h"
#include "wd_syscall.h"
#include "syscall.h"
#include "syscall.h"
#include "fcntl.h"
#include "fcntl.h"
#include "errno.h"
IMPORTWDSYSCALL
IMPORTWDSYSCALL
...
@@ -149,12 +150,9 @@ int read_file(const char *file_path, const char *mode, char *r_buf, size_t r_len
...
@@ -149,12 +150,9 @@ int read_file(const char *file_path, const char *mode, char *r_buf, size_t r_len
}
}
int
is_file_exists
(
const
char
*
file_path
)
{
int
is_file_exists
(
const
char
*
file_path
)
{
int
res
;
int
fd
=
WDSYSCALL
(
SYS_faccessat
,
AT_FDCWD
,
file_path
,
R_OK
,
0
);
int
fd
=
WDSYSCALL
(
SYS_openat
,
AT_FDCWD
,
file_path
,
O_RDONLY
,
0
);
int
err
=
errno
;
if
(
fd
==
-
1
)
res
=
0
;
if
(
fd
==
-
1
)
return
0
;
else
{
WDSYSCALL
(
SYS_close
,
fd
);
WDSYSCALL
(
SYS_close
,
fd
);
return
1
;
res
=
1
;
}
return
res
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment