Change hard-coded temporary directory.

The properties tests creates a temporary directory in /data/nativetest,
but this directory might not exist in all circumstances.
Change this to create the temporary directory in /data/local/tmp.

Change-Id: I812d3e24fcd084c5d74055c9faa95b1656f255bc
This commit is contained in:
Christopher Ferris 2013-08-15 12:54:40 -07:00
parent c5cf53701a
commit bd6dc6a886
2 changed files with 4 additions and 4 deletions

View File

@ -32,10 +32,10 @@ struct LocalPropertyTestState {
LocalPropertyTestState(int nprops) : nprops(nprops), valid(false) {
static const char prop_name_chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_";
char dir_template[] = "/data/nativetest/prop-XXXXXX";
char dir_template[] = "/data/local/tmp/prop-XXXXXX";
char *dirname = mkdtemp(dir_template);
if (!dirname) {
perror("making temp file for test state failed (is /data/nativetest writable?)");
perror("making temp file for test state failed (is /data/local/tmp writable?)");
return;
}

View File

@ -28,10 +28,10 @@ extern void *__system_property_area__;
struct LocalPropertyTestState {
LocalPropertyTestState() : valid(false) {
char dir_template[] = "/data/nativetest/prop-XXXXXX";
char dir_template[] = "/data/local/tmp/prop-XXXXXX";
char *dirname = mkdtemp(dir_template);
if (!dirname) {
perror("making temp file for test state failed (is /data/nativetest writable?)");
perror("making temp file for test state failed (is /data/local/tmp writable?)");
return;
}