aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/main.c b/main.c
index 437e621..0cf687c 100644
--- a/main.c
+++ b/main.c
@@ -6,7 +6,6 @@
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
-#include <dirent.h>
#include <sys/stat.h>
#include <sys/sendfile.h>
#include <sys/capability.h>
@@ -144,41 +143,6 @@ static bool set_gsr_files_set_permissions_and_capabilities(const char *kms_serve
return true;
}
-/* This works even if the files require root access to modify, since we are just unlinking, not modifying them */
-static bool remove_directory_recursive(const char *filepath) {
- DIR *dir = opendir(filepath);
- if(!dir)
- return false;
-
- char file[PATH_MAX];
- struct dirent *entry;
- while((entry = readdir(dir)) != NULL) {
- if(strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
- continue;
-
- snprintf(file, sizeof(file), "%s/%s", filepath, entry->d_name);
- struct stat st;
- if(stat(file, &st) == -1)
- continue;
-
- if(S_ISDIR(st.st_mode)) {
- if(!remove_directory_recursive(file))
- return false;
- }
-
- if(remove(file) != 0)
- return false;
- }
-
- return true;
-}
-
-static bool remove_local_gsr_files(const char *user_homepath) {
- char gsr_dir_local_filepath[PATH_MAX];
- snprintf(gsr_dir_local_filepath, sizeof(gsr_dir_local_filepath), "%s/.local/share/gpu-screen-recorder", user_homepath);
- return remove_directory_recursive(gsr_dir_local_filepath);
-}
-
/* |gsr_global_hotkeys_local_filepath| can be NULL */
static bool setup_local_gsr_files(const char *user_homepath, const char *kms_server_proxy_local_filepath) {
if(!create_local_kms_server_proxy_directory(user_homepath)) {
@@ -217,7 +181,6 @@ static int setup_gsr_ui(const char *user_homepath) {
return 0;
} else {
- remove_local_gsr_files(user_homepath);
if(!setup_local_gsr_files(user_homepath, kms_server_proxy_local_filepath))
return 1;
@@ -268,7 +231,6 @@ static int launch_gsr_kms_server(const char *initial_socket_path, const char *ca
const char *args[] = { GSR_KMS_SERVER_FILEPATH, initial_socket_path, card_path, NULL };
return execv(args[0], (char *const*)args);
} else {
- remove_local_gsr_files(user_homepath);
if(!setup_local_gsr_files(user_homepath, kms_server_proxy_local_filepath))
return 1;