aboutsummaryrefslogtreecommitdiff
path: root/dexopt
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2010-09-12 17:34:35 -0700
committerDan Bornstein <danfuzz@android.com>2010-09-12 17:41:18 -0700
commitdd2502bd371ddca554b7a3d900fe120a3e7767ec (patch)
tree313d000a082a5050aa1868a9d4c3f43fb2a41bb4 /dexopt
parent4701d5f8d0e691eeb9a0824311d5166d301a5aa5 (diff)
Move declarations to the top to avoid potential uninitialized use.
I didn't catch the warnings among the build spew before. Also, made "--preopt" use stderr for its complaints about arguments. Change-Id: I8d470ccc40c4cdc9131beb0991060358039e2727
Diffstat (limited to 'dexopt')
-rw-r--r--dexopt/OptMain.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/dexopt/OptMain.c b/dexopt/OptMain.c
index 276db82c8..ca7031e17 100644
--- a/dexopt/OptMain.c
+++ b/dexopt/OptMain.c
@@ -322,8 +322,17 @@ bail:
*/
static int preopt(int argc, char* const argv[])
{
+ int zipFd = -1;
+ int outFd = -1;
+ int result = -1;
+
if (argc != 5) {
- LOGE("Wrong number of args for --preopt (found %d)\n", argc);
+ /*
+ * Use stderr here, since this variant is meant to be called on
+ * the host side.
+ */
+ fprintf(stderr, "Wrong number of args for --preopt (found %d)\n",
+ argc);
goto bail;
}
@@ -331,10 +340,6 @@ static int preopt(int argc, char* const argv[])
const char* outName = argv[3];
const char* dexoptFlags = argv[4];
- int zipFd = -1;
- int outFd = -1;
- int result = -1;
-
zipFd = open(zipName, O_RDONLY);
if (zipFd < 0) {
perror(argv[0]);