aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/android/perms.c16
-rw-r--r--e2fsck/Android.bp1
-rw-r--r--lib/ext2fs/Android.bp14
-rw-r--r--lib/support/Android.bp1
-rw-r--r--misc/Android.bp4
-rw-r--r--resize/Android.bp1
6 files changed, 17 insertions, 20 deletions
diff --git a/contrib/android/perms.c b/contrib/android/perms.c
index 3c42e597..9c5ec05b 100644
--- a/contrib/android/perms.c
+++ b/contrib/android/perms.c
@@ -81,9 +81,10 @@ static errcode_t set_selinux_xattr(ext2_filsys fs, ext2_ino_t ino,
retval = selabel_lookup(params->sehnd, &secontext, params->filename,
inode.i_mode);
if (retval < 0) {
- com_err(__func__, retval,
+ int saved_errno = errno;
+ com_err(__func__, errno,
_("searching for label \"%s\""), params->filename);
- return retval;
+ return saved_errno;
}
retval = ino_add_xattr(fs, ino, "security." XATTR_SELINUX_SUFFIX,
@@ -187,7 +188,7 @@ static errcode_t set_timestamp(ext2_filsys fs, ext2_ino_t ino,
}
retval = lstat(src_filename, &stat);
if (retval < 0) {
- com_err(__func__, retval,
+ com_err(__func__, errno,
_("while lstat file %s"), src_filename);
goto end;
}
@@ -339,18 +340,19 @@ errcode_t android_configure_fs(ext2_filsys fs, char *src_dir, char *target_out,
if (nopt > 0) {
sehnd = selabel_open(SELABEL_CTX_FILE, seopts, nopt);
if (!sehnd) {
- com_err(__func__, -EINVAL,
+ int saved_errno = errno;
+ com_err(__func__, errno,
_("while opening file contexts \"%s\""),
seopts[0].value);
- return -EINVAL;
+ return saved_errno;
}
}
#else
sehnd = selinux_android_file_context_handle();
if (!sehnd) {
- com_err(__func__, -EINVAL,
+ com_err(__func__, EINVAL,
_("while opening android file_contexts"));
- return -EINVAL;
+ return EINVAL;
}
#endif
diff --git a/e2fsck/Android.bp b/e2fsck/Android.bp
index f3f70a0a..f3443127 100644
--- a/e2fsck/Android.bp
+++ b/e2fsck/Android.bp
@@ -44,6 +44,7 @@ cc_defaults {
e2fsck_libs = [
"libext2fs",
"libext2_blkid",
+ "libext2_com_err",
"libext2_uuid",
"libext2_quota",
"libext2_e2p",
diff --git a/lib/ext2fs/Android.bp b/lib/ext2fs/Android.bp
index 5d10d3f7..e09ec3fb 100644
--- a/lib/ext2fs/Android.bp
+++ b/lib/ext2fs/Android.bp
@@ -91,24 +91,14 @@ cc_library {
"test_io.c",
],
shared_libs: [
+ "libext2_com_err",
"libsparse",
"libz",
],
- whole_static_libs: [
- "libext2_com_err"
- ],
cflags: ["-Wno-unused-parameter"],
target: {
- host: {
- // Consider removing this library as a whole for the host. It is not
- // in the android side.
- whole_static_libs: ["libext2_com_err"],
- },
android: {
- shared_libs: [
- "libext2_com_err",
- "libext2_uuid",
- ],
+ shared_libs: [ "libext2_uuid" ],
},
windows: {
enabled: true,
diff --git a/lib/support/Android.bp b/lib/support/Android.bp
index 894d3357..2bc07b7f 100644
--- a/lib/support/Android.bp
+++ b/lib/support/Android.bp
@@ -21,6 +21,7 @@ cc_library {
shared_libs: [
"libext2fs",
"libext2_blkid",
+ "libext2_com_err",
],
target: {
diff --git a/misc/Android.bp b/misc/Android.bp
index 301ce5d9..dea2f9fe 100644
--- a/misc/Android.bp
+++ b/misc/Android.bp
@@ -21,8 +21,9 @@ cc_library {
],
cflags: ["-Wno-error=format-extra-args"],
shared_libs: [
- "libext2_quota",
"libext2fs",
+ "libext2_com_err",
+ "libext2_quota",
],
system_shared_libs: ["libc", "libdl"],
export_include_dirs: ["."],
@@ -118,6 +119,7 @@ cc_defaults {
tune2fs_libs = [
"libext2_blkid",
+ "libext2_com_err",
"libext2_quota",
"libext2_uuid",
"libext2_e2p",
diff --git a/resize/Android.bp b/resize/Android.bp
index 22d2408d..d55e24c2 100644
--- a/resize/Android.bp
+++ b/resize/Android.bp
@@ -15,6 +15,7 @@ cc_binary {
],
shared_libs: [
"libext2fs",
+ "libext2_com_err",
"libext2_e2p",
"libext2_uuid",
"libext2_blkid",