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. (cherry picked from commit bd6dc6a8864a1997eb8608030ac816740169c463) Change-Id: I15144ece7ffb5c29eded9a1ef399db630f6af5ab
This commit is contained in:
parent
e0d1d4cf49
commit
6d1f85dcdc
@ -32,10 +32,10 @@ struct LocalPropertyTestState {
|
|||||||
LocalPropertyTestState(int nprops) : nprops(nprops), valid(false) {
|
LocalPropertyTestState(int nprops) : nprops(nprops), valid(false) {
|
||||||
static const char prop_name_chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_";
|
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);
|
char *dirname = mkdtemp(dir_template);
|
||||||
if (!dirname) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,10 +28,10 @@ extern void *__system_property_area__;
|
|||||||
|
|
||||||
struct LocalPropertyTestState {
|
struct LocalPropertyTestState {
|
||||||
LocalPropertyTestState() : valid(false) {
|
LocalPropertyTestState() : valid(false) {
|
||||||
char dir_template[] = "/data/nativetest/prop-XXXXXX";
|
char dir_template[] = "/data/local/tmp/prop-XXXXXX";
|
||||||
char *dirname = mkdtemp(dir_template);
|
char *dirname = mkdtemp(dir_template);
|
||||||
if (!dirname) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user