about summary refs log tree commit diff stats
path: root/src/local/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-07-24 19:45:52 +0200
committerbptato <nincsnevem662@gmail.com>2024-07-24 19:46:49 +0200
commitde2a70dc814658a8c72e7da6180ea5e16a8b985b (patch)
treec089a85e65d0069e2d51b12d1553ada8c2a63ea6 /src/local/client.nim
parent40122721d3b25d3b7e75f93e64d88853d1c9c0f2 (diff)
downloadchawan-de2a70dc814658a8c72e7da6180ea5e16a8b985b.tar.gz
client, sandbox: fix termux build
Still not perfect, because it crashes on missing /tmp dir so you have to
manually set it...
Diffstat (limited to 'src/local/client.nim')
-rw-r--r--src/local/client.nim13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/local/client.nim b/src/local/client.nim
index 97390528..1fc5a7f1 100644
--- a/src/local/client.nim
+++ b/src/local/client.nim
@@ -359,7 +359,8 @@ proc input(client: Client): EmptyPromise =
     p.resolve()
   return p
 
-let SIGWINCH {.importc, header: "<signal.h>", nodecl.}: cint
+when not defined(android):
+  let SIGWINCH {.importc, header: "<signal.h>", nodecl.}: cint
 
 proc showConsole(client: Client) {.jsfunc.} =
   let container = client.consoleWrapper.container
@@ -546,7 +547,8 @@ proc handleError(client: Client; fd: int) =
 proc inputLoop(client: Client) =
   let selector = client.selector
   selector.registerHandle(int(client.pager.term.istream.fd), {Read}, 0)
-  let sigwinch = selector.registerSignal(int(SIGWINCH), 0)
+  when not defined(android):
+    let sigwinch = selector.registerSignal(int(SIGWINCH), 0)
   while true:
     let events = client.selector.select(-1)
     for event in events:
@@ -556,9 +558,10 @@ proc inputLoop(client: Client) =
         client.handleWrite(event.fd)
       if Error in event.events:
         client.handleError(event.fd)
-      if Signal in event.events:
-        assert event.fd == sigwinch
-        client.pager.windowChange()
+      when not defined(android):
+        if Signal in event.events:
+          assert event.fd == sigwinch
+          client.pager.windowChange()
       if selectors.Event.Timer in event.events:
         let r = client.timeouts.runTimeoutFd(event.fd)
         assert r