From d8dba8a96c65c2522351eca431709c9f7536dbea Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 29 Nov 2019 12:03:38 -0500 Subject: [PATCH] Graceful fallback when /tmp is amounted noexec on Linux Fixes #260 --- .../java/com/velocitypowered/natives/util/Natives.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/native/src/main/java/com/velocitypowered/natives/util/Natives.java b/native/src/main/java/com/velocitypowered/natives/util/Natives.java index 44329434a..a3a229037 100644 --- a/native/src/main/java/com/velocitypowered/natives/util/Natives.java +++ b/native/src/main/java/com/velocitypowered/natives/util/Natives.java @@ -37,7 +37,12 @@ public class Natives { // Well, it doesn't matter... } })); - System.load(tempFile.toAbsolutePath().toString()); + + try { + System.load(tempFile.toAbsolutePath().toString()); + } catch (UnsatisfiedLinkError e) { + throw new NativeSetupException("Unable to load native " + tempFile.toAbsolutePath(), e); + } } catch (IOException e) { throw new NativeSetupException("Unable to copy natives", e); }