summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-03-29 13:24:33 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-03-29 13:24:33 +0200
commitb4f1eef3a3b0ff56d0a68c15c43ffecb7778e939 (patch)
tree155c89de595d429d7f13d460eb1e24aca7543647 /lib
parentf6e92dcf75dcfe3f85ebce94bea2f8912214116d (diff)
parent452696b980a9c89c75496fffe19d4c5a560aebce (diff)
downloadNim-b4f1eef3a3b0ff56d0a68c15c43ffecb7778e939.tar.gz
Merge pull request #4008 from aberghage/dynlib-errors-to-stderr
Makes dyncall errors report to stderr.
Diffstat (limited to 'lib')
-rw-r--r--lib/system/dyncalls.nim14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim
index 6dc8999d1..ba5e4bbeb 100644
--- a/lib/system/dyncalls.nim
+++ b/lib/system/dyncalls.nim
@@ -23,16 +23,16 @@ proc rawWrite(f: File, s: string) =
 
 proc nimLoadLibraryError(path: string) =
   # carefully written to avoid memory allocation:
-  stdout.rawWrite("could not load: ")
-  stdout.rawWrite(path)
-  stdout.rawWrite("\n")
+  stderr.rawWrite("could not load: ")
+  stderr.rawWrite(path)
+  stderr.rawWrite("\n")
   quit(1)
 
 proc procAddrError(name: cstring) {.noinline.} =
   # carefully written to avoid memory allocation:
-  stdout.rawWrite("could not import: ")
-  stdout.write(name)
-  stdout.rawWrite("\n")
+  stderr.rawWrite("could not import: ")
+  stderr.write(name)
+  stderr.rawWrite("\n")
   quit(1)
 
 # this code was inspired from Lua's source code:
@@ -71,7 +71,7 @@ when defined(posix):
     when defined(nimDebugDlOpen):
       let error = dlerror()
       if error != nil:
-        c_fprintf(c_stdout, "%s\n", error)
+        c_fprintf(c_stderr, "%s\n", error)
 
   proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr =
     result = dlsym(lib, name)