remove "Error occurred on locking entity" messages

Those should not be printed to stderr (or wherever), there are errors
returned in these cases ...

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-04-19 22:01:11 +02:00 committed by eboasson
parent 9c1a739559
commit 1ecad3c047
6 changed files with 3 additions and 31 deletions

View file

@ -404,11 +404,9 @@ dds_return_t dds_get_listener (dds_entity_t entity, dds_listener_t *listener)
ddsrt_mutex_unlock (&e->m_observers_lock);
dds_entity_unlock(e);
} else {
DDS_ERROR("Error occurred on locking entity\n");
ret = DDS_ERRNO(rc);
}
} else {
DDS_ERROR("Argument listener is NULL\n");
ret = DDS_ERRNO(DDS_RETCODE_BAD_PARAMETER);
}

View file

@ -134,18 +134,15 @@ dds_register_instance(
dds_retcode_t rc;
if(data == NULL){
DDS_ERROR("Argument data is NULL\n");
ret = DDS_ERRNO(DDS_RETCODE_BAD_PARAMETER);
goto err;
}
if(handle == NULL){
DDS_ERROR("Argument handle is NULL\n");
ret = DDS_ERRNO(DDS_RETCODE_BAD_PARAMETER);
goto err;
}
rc = dds_writer_lock(writer, &wr);
if (rc != DDS_RETCODE_OK) {
DDS_ERROR("Error occurred on locking writer\n");
ret = DDS_ERRNO(rc);
goto err;
}
@ -155,7 +152,6 @@ dds_register_instance(
*handle = inst->m_iid;
ret = DDS_RETCODE_OK;
} else {
DDS_ERROR("Unable to create instance\n");
ret = DDS_ERRNO(DDS_RETCODE_ERROR);
}
thread_state_asleep (ts1);
@ -194,18 +190,15 @@ dds_unregister_instance_ts(
dds_writer *wr;
if (data == NULL){
DDS_ERROR("Argument data is NULL\n");
ret = DDS_ERRNO(DDS_RETCODE_BAD_PARAMETER);
goto err;
}
if(timestamp < 0){
DDS_ERROR("Argument timestamp has negative value\n");
ret = DDS_ERRNO(DDS_RETCODE_BAD_PARAMETER);
goto err;
}
rc = dds_writer_lock(writer, &wr);
if (rc != DDS_RETCODE_OK) {
DDS_ERROR("Error occurred on locking writer\n");
ret = DDS_ERRNO(rc);
goto err;
}
@ -241,7 +234,6 @@ dds_unregister_instance_ih_ts(
rc = dds_writer_lock(writer, &wr);
if (rc != DDS_RETCODE_OK) {
DDS_ERROR("Error occurred on locking writer\n");
ret = DDS_ERRNO(rc);
goto err;
}
@ -264,7 +256,6 @@ dds_unregister_instance_ih_ts(
ret = dds_write_impl (wr, sample, timestamp, action);
ddsi_sertopic_free_sample (tp, sample, DDS_FREE_ALL);
} else {
DDS_ERROR("No instance related with the provided handle is found\n");
ret = DDS_ERRNO(DDS_RETCODE_PRECONDITION_NOT_MET);
}
thread_state_asleep (ts1);
@ -294,7 +285,6 @@ dds_writedispose_ts(
thread_state_asleep (ts1);
dds_writer_unlock(wr);
} else {
DDS_ERROR("Error occurred on locking writer\n");
ret = DDS_ERRNO(rc);
}
@ -336,7 +326,6 @@ dds_dispose_ts(
thread_state_asleep (ts1);
dds_writer_unlock(wr);
} else {
DDS_ERROR("Error occurred on locking writer\n");
ret = DDS_ERRNO(rc);
}
@ -366,13 +355,11 @@ dds_dispose_ih_ts(
ret = dds_dispose_impl (wr, sample, handle, timestamp);
ddsi_sertopic_free_sample (tp, sample, DDS_FREE_ALL);
} else {
DDS_ERROR("No instance related with the provided handle is found\n");
ret = DDS_ERRNO(DDS_RETCODE_PRECONDITION_NOT_MET);
}
thread_state_asleep (ts1);
dds_writer_unlock(wr);
} else {
DDS_ERROR("Error occurred on locking writer\n");
ret = DDS_ERRNO(rc);
}
@ -391,7 +378,6 @@ dds_lookup_instance(
struct ddsi_serdata *sd;
if(data == NULL){
DDS_ERROR("Argument data is NULL\n");
goto err;
}
@ -402,8 +388,6 @@ dds_lookup_instance(
ih = ddsi_tkmap_lookup (map, sd);
ddsi_serdata_unref (sd);
thread_state_asleep (ts1);
} else {
DDS_ERROR("Acquired topic is NULL\n");
}
err:
return ih;
@ -429,14 +413,12 @@ dds_instance_get_key(
struct ddsi_tkmap_instance * tk;
if(data == NULL){
DDS_ERROR("Argument data is NULL\n");
ret = DDS_ERRNO(DDS_RETCODE_BAD_PARAMETER);
goto err;
}
topic = dds_instance_info_by_hdl (entity);
if(topic == NULL){
DDS_ERROR("Could not find topic related to the given entity\n");
ret = DDS_ERRNO(DDS_RETCODE_BAD_PARAMETER);
goto err;
}
@ -447,7 +429,6 @@ dds_instance_get_key(
ddsi_tkmap_instance_unref (tk);
ret = DDS_RETCODE_OK;
} else {
DDS_ERROR("No instance related with the provided entity is found\n");
ret = DDS_ERRNO(DDS_RETCODE_BAD_PARAMETER);
}
thread_state_asleep (ts1);

View file

@ -37,7 +37,6 @@ dds_participant_status_validate(
dds_return_t ret = DDS_RETCODE_OK;
if (mask & ~(DDS_PARTICIPANT_STATUS_MASK)) {
DDS_ERROR("Argument mask is invalid\n");
ret = DDS_ERRNO(DDS_RETCODE_BAD_PARAMETER);
}

View file

@ -123,7 +123,6 @@ dds_read_impl(
thread_state_awake (ts1);
rc = dds_read_lock(reader_or_condition, &rd, &cond, only_reader);
if (rc != DDS_RETCODE_OK) {
DDS_ERROR("Error occurred on locking entity\n");
ret = DDS_ERRNO(rc);
goto fail_awake;
}
@ -223,7 +222,6 @@ dds_readcdr_impl(
}
dds_read_unlock(rd, cond);
} else {
DDS_ERROR("Error occurred on locking entity\n");
ret = DDS_ERRNO(rc);
}
@ -695,7 +693,6 @@ dds_return_loan(
rc = dds_read_lock(reader_or_condition, &rd, &cond, false);
if (rc != DDS_RETCODE_OK) {
DDS_ERROR("Error occurred on locking entity\n");
ret = DDS_ERRNO(rc);
goto fail;
}

View file

@ -200,7 +200,6 @@ dds_find_topic(
ddsrt_mutex_unlock (&dds_global.m_mutex);
dds_entity_unlock(p);
} else {
DDS_ERROR("Error occurred on locking entity\n");
tp = DDS_ERRNO(rc);
}
} else {
@ -334,7 +333,6 @@ dds_create_topic_arbitrary (
rc = dds_entity_lock(participant, DDS_KIND_PARTICIPANT, &par);
if (rc != DDS_RETCODE_OK) {
DDS_ERROR("Error occurred on locking entity\n");
hdl = DDS_ERRNO(rc);
goto lock_err;
}

View file

@ -217,7 +217,6 @@ dds_create_waitset(
waitset->triggered = NULL;
dds_entity_unlock(par);
} else {
DDS_ERROR("Error occurred on locking entity\n");
hdl = DDS_ERRNO(rc);
}