summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/ribmgr.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-12-01 11:15:41 +0100
committerSander Vrijders <[email protected]>2016-12-02 10:34:36 +0100
commitb99037eae6a7af058cdb56f316d9c8e4ca603d86 (patch)
tree99ff47c186fe80ffbb8ab124f73e2dbb99ed0eef /src/ipcpd/normal/ribmgr.c
parent8e0165c2ee9659ee57934947369659c093db621e (diff)
downloadouroboros-b99037eae6a7af058cdb56f316d9c8e4ca603d86.tar.gz
ouroboros-b99037eae6a7af058cdb56f316d9c8e4ca603d86.zip
ipcpd: normal: Address review comments
This addresses some comments after a code review by Dimitri.
Diffstat (limited to 'src/ipcpd/normal/ribmgr.c')
-rw-r--r--src/ipcpd/normal/ribmgr.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c
index 3cebde0c..3e305ffe 100644
--- a/src/ipcpd/normal/ribmgr.c
+++ b/src/ipcpd/normal/ribmgr.c
@@ -404,7 +404,7 @@ static struct rnode * ribmgr_ro_create(const char * name,
timeout = attr.expiry.tv_sec * 1000 +
attr.expiry.tv_nsec / MILLION;
if (timerwheel_add(rib.wheel, ro_delete_timer,
- new->full_name, strlen(new->full_name),
+ new->full_name, strlen(new->full_name) + 1,
timeout)) {
LOG_ERR("Failed to add deletion timer of RO.");
}
@@ -1400,8 +1400,7 @@ int ro_create(const char * name,
ro_msg_t msg = RO_MSG__INIT;
struct ro_attr rattr;
- if (name == NULL)
- return -EINVAL;
+ assert(name);
if (attr == NULL) {
ro_attr_init(&rattr);
@@ -1456,8 +1455,7 @@ int ro_delete(const char * name)
struct rnode * node;
ro_msg_t msg = RO_MSG__INIT;
- if (name == NULL)
- return -EINVAL;
+ assert(name);
pthread_mutex_lock(&rib.ro_lock);
@@ -1499,8 +1497,8 @@ int ro_write(const char * name,
struct rnode * node;
ro_msg_t msg = RO_MSG__INIT;
- if (name == NULL || data == NULL)
- return -EINVAL;
+ assert(name);
+ assert(data);
pthread_mutex_lock(&rib.ro_lock);
@@ -1540,8 +1538,8 @@ ssize_t ro_read(const char * name,
struct rnode * node;
ssize_t len;
- if (name == NULL || data == NULL)
- return -EINVAL;
+ assert(name);
+ assert(data);
pthread_mutex_lock(&rib.ro_lock);
@@ -1570,8 +1568,8 @@ int ro_subscribe(const char * name,
{
struct ro_sub * sub;
- if (name == NULL || ops == NULL)
- return -EINVAL;
+ assert(name);
+ assert(ops);
sub = malloc(sizeof(*sub));
if (sub == NULL)