diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:01:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:01:24 +0000 |
commit | 1e2ccef73c5ca96f7884a452b65cdbbff51c43ca (patch) | |
tree | 15afec6ee566d7919e0e640816faeebc777e3911 /scripts | |
parent | Initial commit. (diff) | |
download | gnome-system-monitor-1e2ccef73c5ca96f7884a452b65cdbbff51c43ca.tar.xz gnome-system-monitor-1e2ccef73c5ca96f7884a452b65cdbbff51c43ca.zip |
Adding upstream version 3.38.0.upstream/3.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/gsm_execute_helper.c | 16 | ||||
-rw-r--r-- | scripts/meson.build | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/scripts/gsm_execute_helper.c b/scripts/gsm_execute_helper.c new file mode 100644 index 0000000..2f20a85 --- /dev/null +++ b/scripts/gsm_execute_helper.c @@ -0,0 +1,16 @@ +#include <unistd.h> +#include <errno.h> +#include <string.h> +#include <glib.h> + +int main(int argc, char* argv[]) +{ + gchar **argv_modified; + argv_modified = g_new0 (gchar *, argc + 1); + memcpy (argv_modified, argv, argc * sizeof (char*)); + argv_modified[0] = COMMAND; + if ( execvp(COMMAND, argv_modified) == -1) { + return errno; + } + return 0; +} diff --git a/scripts/meson.build b/scripts/meson.build new file mode 100644 index 0000000..99e8094 --- /dev/null +++ b/scripts/meson.build @@ -0,0 +1,16 @@ +commands = [ + 'renice', + 'kill', +] + +foreach command : commands + executable('gsm-' + command, + 'gsm_execute_helper.c', + dependencies: [ + glib, + ], + c_args: '-DCOMMAND="@0@"'.format(command), + install: true, + install_dir: join_paths(get_option('libexecdir'), meson.project_name()) + ) +endforeach |