From fb31765cbe33890f325a87015507364156741321 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:59:44 +0200 Subject: Adding upstream version 42.0. Signed-off-by: Daniel Baumann --- scripts/gsm_execute_helper.c | 16 ++++++++++++++++ scripts/meson.build | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 scripts/gsm_execute_helper.c create mode 100644 scripts/meson.build (limited to 'scripts') 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 +#include +#include +#include + +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..cb2213c --- /dev/null +++ b/scripts/meson.build @@ -0,0 +1,17 @@ +commands = [ + 'renice', + 'kill', + 'taskset', +] + +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 -- cgit v1.2.3