diff options
author | Jin Qian <jinqian@google.com> | 2017-08-10 11:12:16 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-02-26 12:23:08 -0500 |
commit | 8f8f7a7175b95a6ca735b15db45d43ed7722ea46 (patch) | |
tree | 4ca1e39240dea721718a70cdabf7e010956f1372 | |
parent | 8374979bd8c11139e2d426b8cce233f8c6ed585b (diff) | |
download | e2fsprogs-8f8f7a7175b95a6ca735b15db45d43ed7722ea46.tar.gz |
AOSP: Fix android build warnings in e2fsdroid and libext2fs
Change-Id: I23b7abc8af87d87786523944186de1321726a529
From AOSP commit: 424fa8ce373566040ae6ba31151bfbef566b7166
-rw-r--r-- | contrib/android/e2fsdroid.c | 7 | ||||
-rw-r--r-- | contrib/android/ext2simg.c | 1 | ||||
-rw-r--r-- | contrib/android/perms.c | 4 | ||||
-rw-r--r-- | lib/ext2fs/sparse_io.c | 3 |
4 files changed, 10 insertions, 5 deletions
diff --git a/contrib/android/e2fsdroid.c b/contrib/android/e2fsdroid.c index f043822be..c73b0be52 100644 --- a/contrib/android/e2fsdroid.c +++ b/contrib/android/e2fsdroid.c @@ -1,3 +1,5 @@ +#define _GNU_SOURCE + #include <stdio.h> #include <getopt.h> #include <string.h> @@ -41,7 +43,10 @@ static char *absolute_path(const char *file) char cwd[PATH_MAX]; if (file[0] != '/') { - getcwd(cwd, PATH_MAX); + if (getcwd(cwd, PATH_MAX) == NULL) { + fprintf(stderr, "Failed to getcwd\n"); + exit(EXIT_FAILURE); + } ret = malloc(strlen(cwd) + 1 + strlen(file) + 1); if (ret) sprintf(ret, "%s/%s", cwd, file); diff --git a/contrib/android/ext2simg.c b/contrib/android/ext2simg.c index fcefe1d74..017e16ff7 100644 --- a/contrib/android/ext2simg.c +++ b/contrib/android/ext2simg.c @@ -179,7 +179,6 @@ int main(int argc, char *argv[]) { int opt; int out_fd; - errcode_t retval; struct sparse_file *s; while ((opt = getopt(argc, argv, "czS")) != -1) { diff --git a/contrib/android/perms.c b/contrib/android/perms.c index 1a822cfea..dde90d96f 100644 --- a/contrib/android/perms.c +++ b/contrib/android/perms.c @@ -282,8 +282,8 @@ errcode_t __android_configure_fs(ext2_filsys fs, char *src_dir, errcode_t android_configure_fs(ext2_filsys fs, char *src_dir, char *target_out, char *mountpoint, - struct selinux_opt *seopts, - unsigned int nopt, + struct selinux_opt *seopts EXT2FS_ATTR((unused)), + unsigned int nopt EXT2FS_ATTR((unused)), char *fs_config_file, time_t fixed_time) { errcode_t retval; diff --git a/lib/ext2fs/sparse_io.c b/lib/ext2fs/sparse_io.c index a83baf1f5..1b39b2ec4 100644 --- a/lib/ext2fs/sparse_io.c +++ b/lib/ext2fs/sparse_io.c @@ -270,7 +270,8 @@ static errcode_t sparse_merge_blocks(struct sparse_map *sm, uint64_t start, buf = calloc(num, block_size); if (!buf) { - fprintf(stderr, "failed to alloc %lu\n", num * block_size); + fprintf(stderr, "failed to alloc %llu\n", + (unsigned long long)num * block_size); return EXT2_ET_NO_MEMORY; } |