diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/dev.c | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/src/lib/dev.c b/src/lib/dev.c index e216baab..11ab645d 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -595,6 +595,16 @@ static int flow_init(int       port_id,          return fd;  } +static bool check_python(char * str) +{ +        if (!strcmp(path_strip(str), "python") || +            !strcmp(path_strip(str), "python2") || +            !strcmp(path_strip(str), "python3")) +                return true; + +        return false; +} +  __attribute__((constructor)) static void init(int     argc,                                                char ** argv,                                                char ** envp) @@ -608,6 +618,9 @@ __attribute__((constructor)) static void init(int     argc,          assert(ai.ap_name == NULL); +        if (check_python(argv[0])) +                ap_name = argv[1]; +          ai.api = getpid();          ai.fds = bmp_create(AP_MAX_FLOWS - AP_RES_FDS, AP_RES_FDS); | 
