mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-26 19:51:32 +00:00
configure.ac: Detect the sparse/sparse.h header
commit 2e59ab8fa6519e1169631189bd50810cb6b49426 category: bugfix issue: #I6VAS0 CVE: NA Signed-off-by: DongSenhao <dongsenhao2@huawei.com> --------------------------------------- The <sparse/sparse.h> header is available in Android but not in the Android NDK. Hence this patch that only includes the sparse header file if it is available. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
parent
1d9cbf3c83
commit
89274e8c32
@ -109,6 +109,7 @@ AC_CHECK_HEADERS(m4_flatten([
|
||||
pthread_time.h
|
||||
scsi/sg.h
|
||||
selinux/selinux.h
|
||||
sparse/sparse.h
|
||||
stdlib.h
|
||||
string.h
|
||||
sys/acl.h
|
||||
|
@ -29,6 +29,7 @@
|
||||
#define HAVE_LSEEK64 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_SETMNTENT 1
|
||||
#define HAVE_SPARSE_SPARSE_H 1
|
||||
|
||||
#ifdef WITH_SLOAD
|
||||
#define HAVE_LIBSELINUX 1
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
struct f2fs_configuration c;
|
||||
|
||||
#ifdef WITH_ANDROID
|
||||
#ifdef HAVE_SPARSE_SPARSE_H
|
||||
#include <sparse/sparse.h>
|
||||
struct sparse_file *f2fs_sparse_file;
|
||||
static char **blocks;
|
||||
@ -400,7 +400,7 @@ int dev_read_version(void *buf, __u64 offset, size_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef WITH_ANDROID
|
||||
#ifdef HAVE_SPARSE_SPARSE_H
|
||||
static int sparse_read_blk(__u64 block, int count, void *buf)
|
||||
{
|
||||
int i;
|
||||
@ -651,7 +651,7 @@ int f2fs_fsync_device(void)
|
||||
|
||||
int f2fs_init_sparse_file(void)
|
||||
{
|
||||
#ifdef WITH_ANDROID
|
||||
#ifdef HAVE_SPARSE_SPARSE_H
|
||||
if (c.func == MKFS) {
|
||||
f2fs_sparse_file = sparse_file_new(F2FS_BLKSIZE, c.device_size);
|
||||
if (!f2fs_sparse_file)
|
||||
@ -693,7 +693,7 @@ int f2fs_init_sparse_file(void)
|
||||
|
||||
void f2fs_release_sparse_resource(void)
|
||||
{
|
||||
#ifdef WITH_ANDROID
|
||||
#ifdef HAVE_SPARSE_SPARSE_H
|
||||
int j;
|
||||
|
||||
if (c.sparse_mode) {
|
||||
@ -718,7 +718,7 @@ int f2fs_finalize_device(void)
|
||||
int i;
|
||||
int ret = 0;
|
||||
|
||||
#ifdef WITH_ANDROID
|
||||
#ifdef HAVE_SPARSE_SPARSE_H
|
||||
if (c.sparse_mode) {
|
||||
int64_t chunk_start = (blocks[0] == NULL) ? -1 : 0;
|
||||
uint64_t j;
|
||||
|
@ -39,7 +39,7 @@
|
||||
#ifdef HAVE_SYS_UTSNAME_H
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
#ifdef WITH_ANDROID
|
||||
#ifdef HAVE_SPARSE_SPARSE_H
|
||||
#include <sparse/sparse.h>
|
||||
extern struct sparse_file *f2fs_sparse_file;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user