diff options
Diffstat (limited to 'scripts/gsm_execute_helper.c')
-rw-r--r-- | scripts/gsm_execute_helper.c | 16 |
1 files changed, 16 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; +} |