diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-06-19 13:57:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-19 13:57:03 +0200 |
commit | 082a2bcb9fae62ae35bff29d90d04ea1d15ca14a (patch) | |
tree | 1128c6caf697f9ccb3af4e92dd1d11c43843f34b /platform/x11/joypad_linux.cpp | |
parent | 7fa941bfd8a1d81fc5c27c21635e60846efc52f4 (diff) | |
parent | ce1c840635ef2970259d5a88a65cac33d32837b6 (diff) | |
download | redot-engine-082a2bcb9fae62ae35bff29d90d04ea1d15ca14a.tar.gz |
Merge pull request #29893 from capnm/capnm-posix-read-write-return
Linux: Check return values of posix read/write
Diffstat (limited to 'platform/x11/joypad_linux.cpp')
-rw-r--r-- | platform/x11/joypad_linux.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp index 3e9e8033e8..21c3b0ac91 100644 --- a/platform/x11/joypad_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -414,7 +414,9 @@ void JoypadLinux::joypad_vibration_start(int p_id, float p_weak_magnitude, float play.type = EV_FF; play.code = effect.id; play.value = 1; - write(joy.fd, (const void *)&play, sizeof(play)); + if (write(joy.fd, (const void *)&play, sizeof(play)) == -1) { + print_verbose("Couldn't write to Joypad device."); + } joy.ff_effect_id = effect.id; joy.ff_effect_timestamp = p_timestamp; |