diff options
author | David Anderson <dvander@google.com> | 2019-01-29 10:00:56 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-01-29 10:00:56 -0800 |
commit | 212d5323e69696f4afe69c1b9551d7e02a14ab8a (patch) | |
tree | 4ee1ac95f3ee18f27c1abee7a46d6c322552875a | |
parent | d988edb25fdee0d02b4da1fa6182cbbb32675b64 (diff) | |
parent | e8bb31c64b61ede0492a210b2e8bf346805d4918 (diff) | |
download | android_external_e2fsprogs-212d5323e69696f4afe69c1b9551d7e02a14ab8a.tar.gz android_external_e2fsprogs-212d5323e69696f4afe69c1b9551d7e02a14ab8a.tar.bz2 android_external_e2fsprogs-212d5323e69696f4afe69c1b9551d7e02a14ab8a.zip |
Merge "e2fsdroid: Fix incorrect error value handling." am: 04351bfa18
am: e8bb31c64b
Change-Id: Iff63c318cdebdafb28ad9717b48fd88b27301ac8
-rw-r--r-- | contrib/android/perms.c | 16 |
1 files changed, 9 insertions, 7 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 |