Compare commits
1 Commits
cdfb1e39c0
...
master
Author | SHA1 | Date | |
---|---|---|---|
a513909189 |
@ -6,6 +6,7 @@
|
|||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
||||||
extern PID_t PID;
|
extern PID_t PID;
|
||||||
|
extern Dev_t ps2kbdev;
|
||||||
|
|
||||||
static InterpResult RES;
|
static InterpResult RES;
|
||||||
|
|
||||||
@ -214,11 +215,10 @@ bool interp_runstring(char *string, InterpResult **res, bool logcmds, bool inter
|
|||||||
|
|
||||||
processctl(app, PCTL_RUN, 0, 0, 0);
|
processctl(app, PCTL_RUN, 0, 0, 0);
|
||||||
|
|
||||||
uint8_t b;
|
|
||||||
while(processctl(app, PCTL_POLLSTATE, 0, 0, 0) != 4) {
|
while(processctl(app, PCTL_POLLSTATE, 0, 0, 0) != 4) {
|
||||||
if (interactive) {
|
if (interactive) {
|
||||||
int32_t nrd = ipcpipe(PID, IPCPIPE_IN, IPCPIPE_READ, &b, 1);
|
int32_t key = devctl(&ps2kbdev, DEV_PS2KBDEV_READCH, (uint8_t *)PID, 0, 0);
|
||||||
if (nrd > 0 && b == C('S')) {
|
if (key > 0 && (uint8_t)key == C('S')) {
|
||||||
processctl(app, PCTL_KILL, 0, 0, 0);
|
processctl(app, PCTL_KILL, 0, 0, 0);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user