Skip to content

Commit b93572b

Browse files
committed
Revert "use rmw_enclave_options_xxx APIs instead. (#318)"
This reverts commit 092bf25.
1 parent 092bf25 commit b93572b

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

rmw_microxrcedds_c/src/rmw_init.c

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ rmw_init_options_init(
5252
init_options->instance_id = 0;
5353
init_options->implementation_identifier = eprosima_microxrcedds_identifier;
5454
init_options->allocator = allocator;
55-
init_options->enclave = NULL;
55+
init_options->enclave = "/";
5656
init_options->domain_id = 0;
5757
init_options->security_options = rmw_get_default_security_options();
5858

@@ -133,21 +133,9 @@ rmw_init_options_copy(
133133
return RMW_RET_INVALID_ARGUMENT;
134134
}
135135
memcpy(dst, src, sizeof(rmw_init_options_t));
136-
rmw_ret_t ret;
137-
const rcutils_allocator_t * allocator = &src->allocator;
138-
RCUTILS_CHECK_ALLOCATOR(allocator, return RMW_RET_INVALID_ARGUMENT);
139-
if (src->enclave != NULL) {
140-
// Expecting this does not happen,
141-
// because rmw_microxrcedds does not support SROS 2 security feature.
142-
ret = rmw_enclave_options_copy(src->enclave, allocator, &dst->enclave);
143-
if (RMW_RET_OK != ret) {
144-
return ret;
145-
}
146-
}
136+
147137
rmw_uxrce_mempool_item_t * memory_node = get_memory(&init_options_memory);
148138
if (!memory_node) {
149-
rmw_enclave_options_fini(dst->enclave, allocator);
150-
// Error already assigned below
151139
RMW_UROS_TRACE_MESSAGE("Not available memory node")
152140
return RMW_RET_ERROR;
153141
}
@@ -166,8 +154,7 @@ rmw_init_options_fini(
166154
rmw_init_options_t * init_options)
167155
{
168156
RMW_CHECK_ARGUMENT_FOR_NULL(init_options, RMW_RET_INVALID_ARGUMENT);
169-
rcutils_allocator_t * allocator = &init_options->allocator;
170-
RCUTILS_CHECK_ALLOCATOR(allocator, return RMW_RET_INVALID_ARGUMENT);
157+
RCUTILS_CHECK_ALLOCATOR(&(init_options->allocator), return RMW_RET_INVALID_ARGUMENT);
171158
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
172159
init_options->implementation_identifier,
173160
RMW_RET_INCORRECT_RMW_IMPLEMENTATION);
@@ -188,15 +175,6 @@ rmw_init_options_fini(
188175
return RMW_RET_ERROR;
189176
}
190177

191-
rmw_ret_t ret;
192-
if (init_options->enclave != NULL) {
193-
// Expecting this does not happen,
194-
// because rmw_microxrcedds does not support SROS 2 security feature.
195-
ret = rmw_enclave_options_fini(init_options->enclave, allocator);
196-
if (ret != RMW_RET_OK) {
197-
return ret;
198-
}
199-
}
200178

201179
*init_options = rmw_get_zero_initialized_init_options();
202180

0 commit comments

Comments
 (0)