Merge pull request #983 from fewtarius/dev

Patch powertop to use /storage/.cache.
This commit is contained in:
fewtarius 2023-01-23 08:51:51 -05:00 committed by GitHub
commit 8f19ca45aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,30 @@
diff --git a/src/main.cpp b/src/main.cpp
index 45aaa58..4607aa2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -389,8 +389,8 @@ static void powertop_init(int auto_tune)
srand(time(NULL));
- if (access("/var/cache/", W_OK) == 0)
- mkdir("/var/cache/powertop", 0600);
+ if (access("/storage/.cache/", W_OK) == 0)
+ mkdir("/storage/.cache/powertop", 0600);
else
mkdir("/data/local/powertop", 0600);
diff --git a/src/parameters/parameters.cpp b/src/parameters/parameters.cpp
index 38e1752..c2529ec 100644
--- a/src/parameters/parameters.cpp
+++ b/src/parameters/parameters.cpp
@@ -453,8 +453,8 @@ char* get_param_directory(const char *filename)
{
static char tempfilename[PATH_MAX];
- if (access("/var/cache/powertop", W_OK ) == 0)
- snprintf(tempfilename, sizeof(tempfilename), "/var/cache/powertop/%s", filename);
+ if (access("/storage/.cache/powertop", W_OK ) == 0)
+ snprintf(tempfilename, sizeof(tempfilename), "/storage/.cache/powertop/%s", filename);
if (access("/data/local/powertop", W_OK ) == 0)
snprintf(tempfilename, sizeof(tempfilename), "/data/local/powertop/%s", filename);