void cleanexit(int x) { sleep(2); /* give user a chance to see message */ termrestore(); ExitProcess(x); }
void osreboot(char *file, char **argv) { if(dflag == 0) termrestore(); execvp(file, argv); error("reboot failure"); }
void osreboot(char *file, char **argv) { if(rebootok){ termrestore(); execvp(file, argv); panic("reboot failure"); } }
void restore() { /* restore the terminal */ if(dflag == 0) { trace(TRACE_INFO, "node9/kernel: restoring terminal"); termrestore(); } }
void cleanexit(int x) { USED(x); if(up->intwait) { up->intwait = 0; return; } if(dflag == 0) termrestore(); kill(0, SIGKILL); exit(0); }
int readkbd(void) { DWORD r; char buf[1]; if(ReadFile(kbdh, buf, sizeof(buf), &r, 0) == FALSE) panic("keyboard fail"); if (r == 0) panic("keyboard EOF"); if (buf[0] == 0x03) { // INTR (CTRL+C) termrestore(); ExitProcess(0); } if(buf[0] == '\r') buf[0] = '\n'; return buf[0]; }