am dd2502bd: Move declarations to the top to avoid potential uninitialized use.
Merge commit 'dd2502bd371ddca554b7a3d900fe120a3e7767ec' into gingerbread-plus-aosp
* commit 'dd2502bd371ddca554b7a3d900fe120a3e7767ec':
Move declarations to the top to avoid potential uninitialized use.
diff --git a/dexopt/OptMain.c b/dexopt/OptMain.c
index 276db82..ca7031e 100644
--- a/dexopt/OptMain.c
+++ b/dexopt/OptMain.c
@@ -322,8 +322,17 @@
*/
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 @@
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]);