summaryrefslogtreecommitdiffstats
path: root/scripts/gsm_execute_helper.c
blob: 2f20a85106cf787e810ef21fd588b9aa889fc7cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}