Skip to content

Commit a04c14f

Browse files
committed
Remove double rtapi_is_realtime() check
...so harden_rt() never fails and we don't have to handel an error
1 parent 1edca3a commit a04c14f

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/rtapi/uspace_rtapi_main.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -928,11 +928,7 @@ static void configure_memory() {
928928
free((void *)buf);
929929
}
930930

931-
static int harden_rt() {
932-
if (!rtapi_is_realtime())
933-
return -EINVAL;
934-
935-
WITH_ROOT;
931+
static void harden_rt() {
936932
#if defined(__linux__) && (defined(__x86_64__) || defined(__i386__))
937933
if (iopl(3) < 0) {
938934
rtapi_print_msg(
@@ -1003,7 +999,6 @@ static int harden_rt() {
1003999
// deliberately leak fd until program exit
10041000
}
10051001
#endif /* __linux__ */
1006-
return 0;
10071002
}
10081003

10091004
static RtapiApp *makeDllApp(const std::string &dllName, int policy) {
@@ -1096,10 +1091,11 @@ static RtapiApp *makeApp() {
10961091
if (caps) cap_free(caps);
10971092
#endif
10981093
}
1099-
if (!rt_ok || harden_rt() < 0) {
1094+
if (!rt_ok) {
11001095
app = makeDllApp("liblinuxcnc-uspace-posix.so.0", SCHED_OTHER);
11011096
} else {
11021097
WithRoot r;
1098+
harden_rt();
11031099
if (detect_xenomai_evl()) {
11041100
app = makeDllApp("liblinuxcnc-uspace-xenomai-evl.so.0", SCHED_FIFO);
11051101
} else if (detect_xenomai()) {

0 commit comments

Comments
 (0)