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 /contrib | |
parent | 8374979bd8c11139e2d426b8cce233f8c6ed585b (diff) |
AOSP: Fix android build warnings in e2fsdroid and libext2fs
Change-Id: I23b7abc8af87d87786523944186de1321726a529
From AOSP commit: 424fa8ce373566040ae6ba31151bfbef566b7166
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/android/e2fsdroid.c | 7 | ||||
-rw-r--r-- | contrib/android/ext2simg.c | 1 | ||||
-rw-r--r-- | contrib/android/perms.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/contrib/android/e2fsdroid.c b/contrib/android/e2fsdroid.c index f043822b..c73b0be5 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 fcefe1d7..017e16ff 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 1a822cfe..dde90d96 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; |