diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-01-12 14:58:49 +0100 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-01-12 14:58:49 +0100 |
commit | 4e3c360377bc9b792c2fac83e9402d7531f79bbe (patch) | |
tree | e4409fb32ed7c391f48c3c2699997fc5b75137a1 /src/irmd | |
parent | 7cad036f812a87aafd7c0e8ed4cbea76fb4cb097 (diff) | |
parent | 15e9b779385c71d366776b83540e19e0735c4e66 (diff) | |
download | ouroboros-4e3c360377bc9b792c2fac83e9402d7531f79bbe.tar.gz ouroboros-4e3c360377bc9b792c2fac83e9402d7531f79bbe.zip |
Merged in sandervrijders/ouroboros/be-gam (pull request #345)
Be gam
Diffstat (limited to 'src/irmd')
-rw-r--r-- | src/irmd/ipcp.c | 12 | ||||
-rw-r--r-- | src/irmd/ipcp.h | 6 | ||||
-rw-r--r-- | src/irmd/main.c | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/irmd/ipcp.c b/src/irmd/ipcp.c index cad4dd88..f16587e1 100644 --- a/src/irmd/ipcp.c +++ b/src/irmd/ipcp.c @@ -100,7 +100,7 @@ ipcp_msg_t * send_recv_ipcp_msg(pid_t api, ipcp_msg_t * msg) return recv_msg; } -pid_t ipcp_create(enum ipcp_type ipcp_type) +pid_t ipcp_create(char * name, enum ipcp_type ipcp_type) { pid_t api = -1; char irmd_api[10]; @@ -109,7 +109,7 @@ pid_t ipcp_create(enum ipcp_type ipcp_type) char * full_name = NULL; char * exec_name = NULL; char * log_file = NULL; - char * argv[4]; + char * argv[5]; sprintf(irmd_api, "%u", getpid()); @@ -119,9 +119,8 @@ pid_t ipcp_create(enum ipcp_type ipcp_type) return api; } - if (api != 0) { + if (api != 0) return api; - } if (ipcp_type == IPCP_NORMAL) exec_name = IPCP_NORMAL_EXEC; @@ -162,8 +161,9 @@ pid_t ipcp_create(enum ipcp_type ipcp_type) /* log_file to be placed at the end */ argv[0] = full_name; argv[1] = irmd_api; - argv[2] = log_file; - argv[3] = NULL; + argv[2] = name; + argv[3] = log_file; + argv[4] = NULL; execv(argv[0], &argv[0]); diff --git a/src/irmd/ipcp.h b/src/irmd/ipcp.h index 429e0d5d..658aa2ea 100644 --- a/src/irmd/ipcp.h +++ b/src/irmd/ipcp.h @@ -28,8 +28,8 @@ #ifndef OUROBOROS_IPCP_H #define OUROBOROS_IPCP_H -/* Returns the process id */ -pid_t ipcp_create(enum ipcp_type ipcp_type); +pid_t ipcp_create(char * name, + enum ipcp_type ipcp_type); int ipcp_destroy(pid_t api); @@ -45,7 +45,7 @@ int ipcp_name_reg(pid_t api, int ipcp_name_unreg(pid_t api, char * name); -int ipcp_name_query(pid_t api, +int ipcp_name_query(pid_t api, char * name); int ipcp_flow_alloc(pid_t api, diff --git a/src/irmd/main.c b/src/irmd/main.c index 9dc08cbe..435ee116 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -245,7 +245,7 @@ static pid_t create_ipcp(char * name, enum ipcp_type ipcp_type) pthread_rwlock_wrlock(&irmd->reg_lock); - api->pid = ipcp_create(ipcp_type); + api->pid = ipcp_create(name, ipcp_type); if (api->pid == -1) { pthread_rwlock_unlock(&irmd->reg_lock); pthread_rwlock_unlock(&irmd->state_lock); |