projects/guix·blob python-team · refs

62 lines · 2.2 KiB

1Upstream-status: <https://github.com/spk121/guile-gi/pull/145>
2
3diff --git a/test/main-loop.scm b/test/main-loop.scm
4index 4a1d658..f97676d 100644
5--- a/test/main-loop.scm
6+++ b/test/main-loop.scm
7@@ -7,6 +7,7 @@
8 (string-contains %host-type "-mingw32"))
9
10 (require "GLib" "2.0")
11+(require "GLibUnix" "2.0")
12 (load-by-name "GLib" "IOCondition")
13 (load-by-name "GLib" "MainLoop")
14 (load-by-name "GLib" "MainContext")
15@@ -14,7 +15,7 @@
16 (load-by-name "GLib" "idle_add")
17 (load-by-name "GLib" "timeout_add")
18 (unless mingw?
19- (load-by-name "GLib" "unix_fd_add_full"))
20+ (load-by-name "GLibUnix" "fd_add_full"))
21
22 (define loop #f)
23
24@@ -83,22 +84,22 @@
25 (display unix-fd-sample-text out-port)
26 (newline out-port)
27 (close out-port)
28- (unix-fd-add-full PRIORITY_DEFAULT
29- (port->fdes in-port)
30- (list->iocondition '(hup in))
31- (lambda (fd condition dummy)
32- (cond
33- ((flags-set? condition 'in)
34- (let* ((port (dup->inport fd))
35- (line (get-line port)))
36- (set! unix-fd-result line)
37- #t))
38- ((flags-set? condition 'hup)
39- ;; close in-port on SIGHUP
40- (close in-port)
41- #f)))
42- #f
43- (const #f)))))
44+ (fd-add-full PRIORITY_DEFAULT
45+ (port->fdes in-port)
46+ (list->iocondition '(hup in))
47+ (lambda (fd condition dummy)
48+ (cond
49+ ((flags-set? condition 'in)
50+ (let* ((port (dup->inport fd))
51+ (line (get-line port)))
52+ (set! unix-fd-result line)
53+ #t))
54+ ((flags-set? condition 'hup)
55+ ;; close in-port on SIGHUP
56+ (close in-port)
57+ #f)))
58+ #f
59+ (const #f)))))
60
61 (test-assert "run mainloop"
62 (begin