diff options
author | Raphael <raphael@google.com> | 2010-11-01 15:29:34 -0700 |
---|---|---|
committer | Raphael Moll <ralf@android.com> | 2010-11-16 10:52:51 -0800 |
commit | 2779beecc7410f29102125e87e8174597acb2fe5 (patch) | |
tree | 5957232f7353ab1a18fe33c5ec0a59f0835d70e9 | |
parent | 8285461fa8cdd05cb229a4a73df13b3b8e7766dc (diff) | |
download | external_qemu-2779beecc7410f29102125e87e8174597acb2fe5.zip external_qemu-2779beecc7410f29102125e87e8174597acb2fe5.tar.gz external_qemu-2779beecc7410f29102125e87e8174597acb2fe5.tar.bz2 |
Add env var ANDROID_TMP to override /tmp/android location.
This is needed if there's already a /tmp/android which the current user
can't access on the system. It would prevent the emulator from starting
with a cryptic error message:
NAND: could not create temp file for system NAND disk image: Permission deniedemulator: User-config was not changed.
SDK Bug: 3154431
Change-Id: Iefe7fd6a5139da545aaef5670fb7f42d210d0edc
-rw-r--r-- | android/utils/bufprint.c | 5 | ||||
-rw-r--r-- | hw/goldfish_nand.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/android/utils/bufprint.c b/android/utils/bufprint.c index 45d411f..e3aa63c 100644 --- a/android/utils/bufprint.c +++ b/android/utils/bufprint.c @@ -215,7 +215,10 @@ bufprint_temp_dir(char* buff, char* end) return bufprint(buff, end, "%s", path); #else - const char* tmppath = "/tmp/android"; + const char* tmppath = getenv("ANDROID_TMP"); + if (!tmppath) { + tmppath = "/tmp/android"; + } mkdir(tmppath, 0744); return bufprint(buff, end, "%s", tmppath ); #endif diff --git a/hw/goldfish_nand.c b/hw/goldfish_nand.c index 933edc9..af921b7 100644 --- a/hw/goldfish_nand.c +++ b/hw/goldfish_nand.c @@ -708,7 +708,7 @@ void nand_add_dev(const char *arg) TempFile* tmp = tempfile_create(); if (tmp == NULL) { - XLOG("could not create temp file for %.*s NAND disk image: %s", + XLOG("could not create temp file for %.*s NAND disk image: %s\n", devname_len, devname, strerror(errno)); exit(1); } |