Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/hal/components/enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ int rtapi_app_main(void){

}

void rtapi_app_exit(void) {}

static void decode(void *v_inst, long period){
(void)period;
int i;
Expand Down
8 changes: 7 additions & 1 deletion src/rtapi/uspace_rtapi_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ static int do_load_cmd(const string& name, const vector<string>& args) {
modules.erase(name);
return -1;
}
if(!DLSYM<void(*)(void)>(module, "rtapi_app_exit")) {
rtapi_print_msg(RTAPI_MSG_ERR, "%s: component is missing rtapi_app_exit\n", name.c_str());
dlclose(module);
modules.erase(name);
return -1;
}
int result;

result = do_comp_args(module, args);
Expand Down Expand Up @@ -320,7 +326,7 @@ static int do_unload_cmd(const string& name) {
rtapi_print_msg(RTAPI_MSG_ERR, "%s: not loaded\n", name.c_str());
return -1;
} else {
int (*stop)(void) = DLSYM<int(*)(void)>(w, "rtapi_app_exit");
void (*stop)(void) = DLSYM<void(*)(void)>(w, "rtapi_app_exit");
if(stop) stop();
modules.erase(modules.find(name));
dlclose(w);
Expand Down
Loading