summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml6
-rw-r--r--lib/posix/posix.nim17
-rw-r--r--lib/system.nim4
3 files changed, 17 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml
index 007fef9fe..b4fa886b7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,9 +5,9 @@ os:
   - osx
 dist: trusty
 
-matrix:
-  allow_failures:
-    - os: osx
+#matrix:
+#  allow_failures:
+#    - os: osx
 
 addons:
   apt:
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim
index c230e6598..fa589e905 100644
--- a/lib/posix/posix.nim
+++ b/lib/posix/posix.nim
@@ -985,14 +985,21 @@ proc utimes*(path: cstring, times: ptr array[2, Timeval]): int {.
 proc handle_signal(sig: cint, handler: proc (a: cint) {.noconv.}) {.importc: "signal", header: "<signal.h>".}
 
 template onSignal*(signals: varargs[cint], body: untyped) =
-  ## Setup code to be executed when Unix signals are received. Example:
-  ## from posix import SIGINT, SIGTERM
-  ## onSignal(SIGINT, SIGTERM):
-  ##   echo "bye"
+  ## Setup code to be executed when Unix signals are received. The
+  ## currently handled signal is injected as ``sig`` into the calling
+  ## scope.
+  ##
+  ## Example:
+  ##
+  ## .. code-block::
+  ##   from posix import SIGINT, SIGTERM
+  ##   onSignal(SIGINT, SIGTERM):
+  ##     echo "bye from signal ", sig
 
   for s in signals:
     handle_signal(s,
-      proc (sig: cint) {.noconv.} =
+      proc (signal: cint) {.noconv.} =
+        let sig {.inject.} = signal
         body
     )
 
diff --git a/lib/system.nim b/lib/system.nim
index 28c4f62ab..f62842db2 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1932,10 +1932,10 @@ const
   NimMajor* {.intdefine.}: int = 0
     ## is the major number of Nim's version.
 
-  NimMinor* {.intdefine.}: int = 18
+  NimMinor* {.intdefine.}: int = 19
     ## is the minor number of Nim's version.
 
-  NimPatch* {.intdefine.}: int = 1
+  NimPatch* {.intdefine.}: int = 0
     ## is the patch number of Nim's version.
 
   NimVersion*: string = $NimMajor & "." & $NimMinor & "." & $NimPatch