[bim] Remove direct calls to toaru's fswait2 (use poll wrapper)
This commit is contained in:
parent
191609c30f
commit
0150e2eb4d
19
apps/bim.c
19
apps/bim.c
@ -48,16 +48,11 @@
|
||||
#include <wchar.h>
|
||||
#include <ctype.h>
|
||||
#include <dirent.h>
|
||||
#include <poll.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef __toaru__
|
||||
#include <sys/fswait.h>
|
||||
#else
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
#define BLOCK_SIZE 4096
|
||||
#define ENTER_KEY '\n'
|
||||
#define BACKSPACE_KEY 0x08
|
||||
@ -225,17 +220,6 @@ int bim_getch(void) {
|
||||
_bim_unget = -1;
|
||||
return out;
|
||||
}
|
||||
#ifdef __toaru__
|
||||
int fds[] = {global_config.tty_in};
|
||||
int index = fswait2(1,fds,200);
|
||||
if (index == 0) {
|
||||
unsigned char buf[1];
|
||||
read(global_config.tty_in, buf, 1);
|
||||
return buf[0];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
struct pollfd fds[1];
|
||||
fds[0].fd = global_config.tty_in;
|
||||
fds[0].events = POLLIN;
|
||||
@ -247,7 +231,6 @@ int bim_getch(void) {
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define HISTORY_SENTINEL 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user