From: notaz Date: Fri, 7 Aug 2009 14:11:03 +0000 (+0000) Subject: bugfix + some tweaks X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c2e114ed74047514a95163b191a15c34bdecafc;p=libpicofe.git bugfix + some tweaks git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@737 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/common/emu.c b/common/emu.c index becc0c2..4341d6a 100644 --- a/common/emu.c +++ b/common/emu.c @@ -643,7 +643,8 @@ int emu_read_config(int game, int no_defaults) // read global config, and apply game_def.cfg on top make_config_cfg(cfg); config_readsect(cfg, NULL); - ret = config_readsect("game_def.cfg", sect); + emu_make_path(cfg, "game_def.cfg", sizeof(cfg)); + ret = config_readsect(cfg, sect); } if (ret == 0) diff --git a/linux/in_evdev.c b/linux/in_evdev.c index 4e23677..7866015 100644 --- a/linux/in_evdev.c +++ b/linux/in_evdev.c @@ -317,6 +317,16 @@ static void in_evdev_set_blocking(void *drv_data, int y) perror("in_evdev: F_GETFL fcntl failed"); return; } + + if (flags & O_NONBLOCK) { + /* flush the event queue */ + struct input_event ev; + do { + ret = read(dev->fd, &ev, sizeof(ev)); + } + while (ret == sizeof(ev)); + } + if (y) flags &= ~O_NONBLOCK; else