From 64152635b534798445da076137a57c6aec4347a3 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Tue, 11 Aug 2015 20:20:12 +0200 Subject: [PATCH] linux-dist: Remove unnecessary if case --- core/linux-dist/main.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/core/linux-dist/main.cpp b/core/linux-dist/main.cpp index cdebcf76f..8ef6cb0cd 100755 --- a/core/linux-dist/main.cpp +++ b/core/linux-dist/main.cpp @@ -142,26 +142,25 @@ void SetupInput() lt[port]=0; } #if HOST_OS != OS_DARWIN && !defined(TARGET_EMSCRIPTEN) - if (true) { - #ifdef TARGET_PANDORA - const char* device = "/dev/input/event4"; - #else - const char* device = "/dev/event2"; - #endif - char name[256]= "Unknown"; - - if ((kbfd = open(device, O_RDONLY)) > 0) { - fcntl(kbfd,F_SETFL,O_NONBLOCK); - if(ioctl(kbfd, EVIOCGNAME(sizeof(name)), name) < 0) { - perror("evdev ioctl"); - } - - printf("The device on %s says its name is %s\n",device, name); + #ifdef TARGET_PANDORA + const char* device = "/dev/input/event4"; + #else + const char* device = "/dev/event2"; + #endif + char name[256]= "Unknown"; + + if ((kbfd = open(device, O_RDONLY)) > 0) { + fcntl(kbfd,F_SETFL,O_NONBLOCK); + if(ioctl(kbfd, EVIOCGNAME(sizeof(name)), name) < 0) { + perror("evdev ioctl"); } - else - perror("evdev open"); + + printf("The device on %s says its name is %s\n",device, name); + } + else + perror("evdev open"); // Open joystick device JoyFD = open("/dev/input/js0",O_RDONLY);