Hello hackers,
here's a small patch to make csi happy again when the reset-handler hook is
called.
A small test case:
```
csi -e '(import chicken.tcp)(tcp-accept (tcp-listen 4242))'
# Press ^C
```

Cheers,
LemonBoy
>From 934a424cbf84e7cc31ca07165389946b0d6f19da Mon Sep 17 00:00:00 2001
From: LemonBoy <[email protected]>
Date: Mon, 6 Nov 2017 11:14:48 +0100
Subject: [PATCH] Move the definition of `_ex_software'

The variable is used by ##sys#reset-handler but was defined much later
in the file, resulting in a run-time exception when csi is interrupted.
---
 library.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/library.scm b/library.scm
index bedd7d23..cd5b8042 100644
--- a/library.scm
+++ b/library.scm
@@ -4764,6 +4764,8 @@ EOF
 
 ;;; Default handlers
 
+(define-foreign-variable _ex_software int "EX_SOFTWARE")
+
 (define exit-in-progress #f)
 
 (define exit-handler
@@ -4908,8 +4910,6 @@ EOF
 
 (define ##sys#break-on-error (foreign-value "C_enable_repl" bool))
 
-(define-foreign-variable _ex_software int "EX_SOFTWARE")
-
 (define ##sys#error-handler
   (make-parameter
    (let ([string-append string-append])
-- 
2.11.0

_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to