From 6be9ae98877f23b05f69e6006036fec0f6c9d338 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 26 Apr 2016 14:42:05 +0200 Subject: 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. --- src/ipcpd/ipcp-data.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/ipcpd/ipcp-data.c') 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); -- cgit v1.2.3