Lightweight cross-platform joystick input library
Revisão | 0db6de8c9e74d8c722ba1f2804abfe86f0c35036 (tree) |
---|---|
Hora | 2021-05-11 06:40:50 |
Autor | AlaskanEmily <emily@alas...> |
Commiter | AlaskanEmily |
Properly detect failure to open file descriptors for Unix drivers
@@ -88,7 +88,7 @@ void Rejoy_Unix_IterateGlob(const char *glob_path, | ||
88 | 88 | if(st && |
89 | 89 | /* TODO: This might not even need the block check? */ |
90 | 90 | (S_ISBLK(st->st_mode) || S_ISCHR(st->st_mode)) && |
91 | - (fd = open(path, fd_flags))) { | |
91 | + (fd = open(path, fd_flags)) >= 0) { | |
92 | 92 | |
93 | 93 | cb(arg, path, fd); |
94 | 94 | } |