I didn't catch the warnings among the build spew before. Also, made
"--preopt" use stderr for its complaints about arguments.
Change-Id: I8d470ccc40c4cdc9131beb0991060358039e2727
*/
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;
}
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]);