Fix MODE=tinylinux build

This commit is contained in:
Justine Tunney 2023-10-13 08:30:18 -07:00
parent 4bcb107cb0
commit 0e0398cd5d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 10 additions and 3 deletions

View file

@ -4823,6 +4823,7 @@ static int LuaBlackhole(lua_State *L) {
wontreturn static void Replenisher(void) {
struct timespec ts;
VERBOSEF("(token) replenish worker started");
strace_enabled(-1);
signal(SIGINT, OnTerm);
signal(SIGHUP, OnTerm);
signal(SIGTERM, OnTerm);
@ -7149,7 +7150,7 @@ static void ReplEventLoop(void) {
lua_repl_completions_callback = HandleCompletions;
lua_initrepl(L);
EnableRawMode();
EventLoop(100);
EventLoop(-1);
DisableRawMode();
lua_freerepl();
lua_settop(L, 0); // clear stack

View file

@ -12,6 +12,7 @@
#include "libc/calls/calls.h"
#include "libc/calls/struct/sigaction.h"
#include "libc/calls/struct/timespec.h"
#include "libc/dce.h"
#include "libc/dns/dns.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
@ -122,7 +123,7 @@ static void NewClient(struct Client *client, const struct sockaddr_in *addr) {
}
}
void *Worker(void *arg) {
static void *Worker(void *arg) {
while (!a_finished) {
bool32 ok;
uint32_t dwFlags;
@ -195,12 +196,17 @@ void *Worker(void *arg) {
return 0;
}
void OnTerm(int sig) {
static void OnTerm(int sig) {
a_termsig = sig;
}
int main(int argc, char *argv[]) {
if (!IsWindows()) {
tinyprint(2, "error: this program is intended for windows\n", NULL);
return 1;
}
prog = argv[0];
if (!prog) {
prog = "ab";