summaryrefslogtreecommitdiff
path: root/src/irmd/registry.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-07-05 19:11:26 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-07-05 19:11:26 +0200
commit6c799af1b4cf86a32979d98034c560fb976a9caf (patch)
treef9072634e81bc152c0ca52b927ab9984a845e0e8 /src/irmd/registry.c
parentdb96f7d488681be47abfeec6c636fd4159a37660 (diff)
parentbc9c60382b226e5a75a11a99364b9b799dc2b0c2 (diff)
downloadouroboros-6c799af1b4cf86a32979d98034c560fb976a9caf.tar.gz
ouroboros-6c799af1b4cf86a32979d98034c560fb976a9caf.zip
Merged in dstaesse/ouroboros/be-pid (pull request #157)
lib: Change invalid pid to -1
Diffstat (limited to 'src/irmd/registry.c')
-rw-r--r--src/irmd/registry.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/irmd/registry.c b/src/irmd/registry.c
index 063309a4..a4e2fcfa 100644
--- a/src/irmd/registry.c
+++ b/src/irmd/registry.c
@@ -290,7 +290,7 @@ pid_t reg_entry_resolve_api(struct reg_entry * e)
return r->api;
}
- return 0;
+ return -1;
}
char ** reg_entry_resolve_auto(struct reg_entry * e)
@@ -498,7 +498,7 @@ struct reg_instance * registry_add_ap_instance(struct list_head * registry,
struct reg_entry * e = NULL;
struct reg_instance * i = NULL;
- if (name == NULL || api == 0)
+ if (name == NULL || api == -1)
return NULL;
e = registry_get_entry_by_name(registry, name);
@@ -507,11 +507,6 @@ struct reg_instance * registry_add_ap_instance(struct list_head * registry,
return NULL;
}
- if (api == 0) {
- LOG_DBG("Invalid api.");
- return NULL;
- }
-
if (reg_entry_has_api(e, api)) {
LOG_DBG("Instance already registered with this name.");
return NULL;
@@ -546,8 +541,8 @@ int registry_remove_ap_instance(struct list_head * registry,
struct reg_entry * e = NULL;
struct reg_instance * i = NULL;
- if (name == NULL || api == 0)
- return -1;
+ if (name == NULL || api == -1)
+ return -EINVAL;
e = registry_get_entry_by_name(registry, name);
if (e == NULL) {