diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -59,15 +59,14 @@ static int create_local_kms_server_proxy_directory(const char *home) { char path[PATH_MAX]; int err; - snprintf(path, sizeof(path), "%s/.local", home); - err = mkdir(path, S_IRWXU); - if(err == -1 && errno != EEXIST) - return 0; - - snprintf(path, sizeof(path), "%s/.local/bin", home); - err = mkdir(path, S_IRWXU); - if(err == -1 && errno != EEXIST) - return 0; + const char *paths[] = { ".local", ".local/share", ".local/share/gpu-screen-recorder", NULL }; + for(size_t i = 0; paths[i]; ++i) { + const char *path_part = paths[i]; + snprintf(path, sizeof(path), "%s/%s", home, path_part); + err = mkdir(path, S_IRWXU); + if(err == -1 && errno != EEXIST) + return 0; + } return 1; } @@ -120,7 +119,7 @@ int main(int argc, char **argv) { return 1; char kms_server_proxy_local_filepath[PATH_MAX]; - snprintf(kms_server_proxy_local_filepath, sizeof(kms_server_proxy_local_filepath), "%s/.local/bin/kms-server-proxy", user_homepath); + snprintf(kms_server_proxy_local_filepath, sizeof(kms_server_proxy_local_filepath), "%s/.local/share/gpu-screen-recorder/kms-server-proxy", user_homepath); if(file_has_sys_admin_capability(gsr_kms_server_filepath)) { const char *args[] = { gsr_kms_server_filepath, initial_socket_path, card_path, NULL }; |