mirror of
https://github.com/openharmony/commonlibrary_utils_lite.git
synced 2026-07-18 17:34:26 -04:00
!123 Resolve the dependency order error
Merge pull request !123 from zk/master
This commit is contained in:
+4
-3
@@ -19,14 +19,15 @@ static_library("native_file") {
|
||||
"//commonlibrary/utils_lite/include",
|
||||
"//commonlibrary/utils_lite/hals/file",
|
||||
]
|
||||
deps = [ "//commonlibrary/utils_lite/hals/file:static_hal_file" ]
|
||||
BOARD_DRIVER_HAL_FILE_PATH =
|
||||
rebase_path("//${ohos_board_adapter_dir}/hals/utils/file")
|
||||
rebase_path("${ohos_board_adapter_dir}/hals/utils/file")
|
||||
cmd = "if [ -f ${BOARD_DRIVER_HAL_FILE_PATH}/BUILD.gn ]; then echo true; else echo false; fi"
|
||||
BOARD_DRIVER_HAL_FILE_PATH_EXISTS =
|
||||
exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
|
||||
if (BOARD_DRIVER_HAL_FILE_PATH_EXISTS) {
|
||||
deps += [ "$ohos_board_adapter_dir/hals/utils/file:hal_file_static" ]
|
||||
deps = [ "$ohos_board_adapter_dir/hals/utils/file:hal_file_static" ]
|
||||
} else {
|
||||
deps = [ "//commonlibrary/utils_lite/hals/file:static_hal_file" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,33 +18,33 @@
|
||||
|
||||
#include "hal_file.h"
|
||||
|
||||
__attribute__((weak)) int HalFileOpen(const char *path, int oflag, int mode)
|
||||
int HalFileOpen(const char *path, int oflag, int mode)
|
||||
{
|
||||
(void)mode;
|
||||
return open(path, oflag);
|
||||
}
|
||||
|
||||
__attribute__((weak)) int HalFileClose(int fd)
|
||||
int HalFileClose(int fd)
|
||||
{
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
__attribute__((weak)) int HalFileRead(int fd, char *buf, unsigned int len)
|
||||
int HalFileRead(int fd, char *buf, unsigned int len)
|
||||
{
|
||||
return read(fd, buf, len);
|
||||
}
|
||||
|
||||
__attribute__((weak)) int HalFileWrite(int fd, const char *buf, unsigned int len)
|
||||
int HalFileWrite(int fd, const char *buf, unsigned int len)
|
||||
{
|
||||
return write(fd, buf, len);
|
||||
}
|
||||
|
||||
__attribute__((weak)) int HalFileDelete(const char *path)
|
||||
int HalFileDelete(const char *path)
|
||||
{
|
||||
return unlink(path);
|
||||
}
|
||||
|
||||
__attribute__((weak)) int HalFileStat(const char *path, unsigned int *fileSize)
|
||||
int HalFileStat(const char *path, unsigned int *fileSize)
|
||||
{
|
||||
struct stat info = { 0 };
|
||||
int ret = stat(path, &info);
|
||||
@@ -55,7 +55,7 @@ __attribute__((weak)) int HalFileStat(const char *path, unsigned int *fileSize)
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((weak)) int HalFileSeek(int fd, int offset, unsigned int whence)
|
||||
int HalFileSeek(int fd, int offset, unsigned int whence)
|
||||
{
|
||||
return lseek(fd, offset, whence);
|
||||
}
|
||||
Reference in New Issue
Block a user