diff options
author | Kenny Root <kroot@google.com> | 2010-10-21 16:14:06 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2010-10-21 16:14:06 -0700 |
commit | 0332d1c5a5a0353df9e9b02422b33656930c2941 (patch) | |
tree | 4d10e11973d21478b437de7b0f62e12ddbff846c /cmds | |
parent | 703aae06c0925b19657877bb1872bb2f28874969 (diff) | |
download | frameworks_base-0332d1c5a5a0353df9e9b02422b33656930c2941.zip frameworks_base-0332d1c5a5a0353df9e9b02422b33656930c2941.tar.gz frameworks_base-0332d1c5a5a0353df9e9b02422b33656930c2941.tar.bz2 |
Exit immediately on some linklib failures
If the library couldn't be printed to the string, installd should fail
early instead of trying to chmod() back to uninitialized stat struct.
Bug: 3121721
Change-Id: I8a3604954ae657a1e07c1ad8d5569aa80aff9e0a
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/installd/commands.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index a5b3e0e..2f03c7a 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -946,14 +946,12 @@ int linklib(const char* dataDir, const char* asecLibDir) const size_t libdirLen = strlen(dataDir) + strlen(PKG_LIB_POSTFIX); if (libdirLen >= PKG_PATH_MAX) { LOGE("library dir len too large"); - rc = -1; - goto out; + return -1; } if (snprintf(libdir, sizeof(libdir), "%s%s", dataDir, PKG_LIB_POSTFIX) != (ssize_t)libdirLen) { LOGE("library dir not written successfully: %s\n", strerror(errno)); - rc = -1; - goto out; + return -1; } if (stat(dataDir, &s) < 0) return -1; |