Fix the same issue as in snmp_scalar.c in snmp_threadsync.c

This commit is contained in:
Dirk Ziegelmeier 2018-10-24 08:54:08 +02:00
parent 36e2d2255e
commit ee2f5c52d1

View File

@ -55,7 +55,11 @@ threadsync_get_value_synced(void *ctx)
{
struct threadsync_data *call_data = (struct threadsync_data *)ctx;
call_data->retval.s16 = call_data->proxy_instance.get_value(&call_data->proxy_instance, call_data->arg1.value);
if (call_data->proxy_instance.get_value != NULL) {
call_data->retval.s16 = call_data->proxy_instance.get_value(&call_data->proxy_instance, call_data->arg1.value);
} else {
call_data->retval.s16 = -1;
}
sys_sem_signal(&call_data->threadsync_node->instance->sem);
}
@ -76,7 +80,11 @@ threadsync_set_test_synced(void *ctx)
{
struct threadsync_data *call_data = (struct threadsync_data *)ctx;
call_data->retval.err = call_data->proxy_instance.set_test(&call_data->proxy_instance, call_data->arg2.len, call_data->arg1.value);
if (call_data->proxy_instance.set_test != NULL) {
call_data->retval.err = call_data->proxy_instance.set_test(&call_data->proxy_instance, call_data->arg2.len, call_data->arg1.value);
} else {
call_data->retval.err = SNMP_ERR_NOSUCHINSTANCE;
}
sys_sem_signal(&call_data->threadsync_node->instance->sem);
}
@ -98,7 +106,11 @@ threadsync_set_value_synced(void *ctx)
{
struct threadsync_data *call_data = (struct threadsync_data *)ctx;
call_data->retval.err = call_data->proxy_instance.set_value(&call_data->proxy_instance, call_data->arg2.len, call_data->arg1.value);
if (call_data->proxy_instance.set_value != NULL) {
call_data->retval.err = call_data->proxy_instance.set_value(&call_data->proxy_instance, call_data->arg2.len, call_data->arg1.value);
} else {
call_data->retval.err = SNMP_ERR_NOSUCHINSTANCE;
}
sys_sem_signal(&call_data->threadsync_node->instance->sem);
}