aboutsummaryrefslogtreecommitdiff
path: root/src/Process.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-29 19:29:27 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-29 19:29:27 +0100
commitb865f5cae3c503be65ce55b58fae09589cff3b0f (patch)
treef0f99ba15c726aa5318f29f7773bec38c3c310ce /src/Process.cpp
parent7a1addb28705331b51782dcc2cc10b6e016584cb (diff)
Change name of flatpak systemd service
Diffstat (limited to 'src/Process.cpp')
-rw-r--r--src/Process.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/Process.cpp b/src/Process.cpp
index 347c485..2a704de 100644
--- a/src/Process.cpp
+++ b/src/Process.cpp
@@ -31,15 +31,6 @@ namespace gsr {
return true;
}
- static int count_num_args(const char **args) {
- int num_args = 0;
- while(*args) {
- ++num_args;
- ++args;
- }
- return num_args;
- }
-
bool exec_program_daemonized(const char **args) {
/* 1 argument */
if(args[0] == nullptr)
@@ -152,30 +143,6 @@ namespace gsr {
return exit_status;
}
- int exec_program_on_host_get_stdout(const char **args, std::string &result) {
- if(count_num_args(args) > 64 - 3) {
- fprintf(stderr, "Error: too many arguments when trying to launch \"%s\"\n", args[0]);
- return -1;
- }
-
- const bool inside_flatpak = getenv("FLATPAK_ID") != NULL;
- if(inside_flatpak) {
- // Assumes programs wont need more than 64 - 3 args
- const char *modified_args[64] = { "flatpak-spawn", "--host", "--" };
- for(int i = 3; i < 64; ++i) {
- const char *arg = args[i - 3];
- if(!arg) {
- modified_args[i] = nullptr;
- break;
- }
- modified_args[i] = arg;
- }
- return exec_program_get_stdout(modified_args, result);
- } else {
- return exec_program_get_stdout(args, result);
- }
- }
-
// |output_buffer| should be at least PATH_MAX in size
bool read_cmdline_arg0(const char *filepath, char *output_buffer, int output_buffer_size) {
output_buffer[0] = '\0';