diff options
author | dimitri staessens <[email protected]> | 2016-04-26 14:42:05 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-04-26 14:42:05 +0200 |
commit | 6be9ae98877f23b05f69e6006036fec0f6c9d338 (patch) | |
tree | 4ff4fe417d021c67d9173b4add47c4f2b3403f30 /src/ipcpd/ipcp-data.c | |
parent | a5e2a4cb3ce7bb47ce6b0ad74f11f062bde40e1d (diff) | |
download | ouroboros-6be9ae98877f23b05f69e6006036fec0f6c9d338.tar.gz ouroboros-6be9ae98877f23b05f69e6006036fec0f6c9d338.zip |
lib: instance ID's are now set to the process PID
All instance-id's in ouroboros will be set by the system to the pid of
the process associated with this application process instance. This
means that the user has no way to choose the instance id's. Function
calls that assumed manually defined instance id's have been replaced
throughout the system.
Diffstat (limited to 'src/ipcpd/ipcp-data.c')
-rw-r--r-- | src/ipcpd/ipcp-data.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/ipcpd/ipcp-data.c b/src/ipcpd/ipcp-data.c index e6997e3e..106226de 100644 --- a/src/ipcpd/ipcp-data.c +++ b/src/ipcpd/ipcp-data.c @@ -104,18 +104,28 @@ struct ipcp_data * ipcp_data_create() } struct ipcp_data * ipcp_data_init(struct ipcp_data * dst, - instance_name_t * iname, - enum ipcp_type ipcp_type) + const char * ipcp_name, + enum ipcp_type ipcp_type) { if (dst == NULL) return NULL; - dst->iname = instance_name_dup(iname); + dst->iname = instance_name_create(); + if (dst->iname == NULL) + return NULL; + + if(instance_name_init_from(dst->iname, ipcp_name, getpid()) == NULL) { + instance_name_destroy(dst->iname); + return NULL; + } + dst->type = ipcp_type; dst->dum = shm_du_map_open(); - if (dst->dum == NULL) + if (dst->dum == NULL) { + instance_name_destroy(dst->iname); return NULL; + } /* init the lists */ INIT_LIST_HEAD(&dst->registry); |