summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2016-07-21 16:14:00 +0100
committerGitHub <noreply@github.com>2016-07-21 16:14:00 +0100
commit5784e436624ac4f5118ee33c44b7705538e04020 (patch)
treebb2e00cff64b7c29a341e43d221b6ef7ba6b42bf
parentcf8ee366d10e7e43ab4eae1578367b6a2f02e49c (diff)
downloadNim-5784e436624ac4f5118ee33c44b7705538e04020.tar.gz
Add warning to `osproc.close`
-rw-r--r--lib/pure/osproc.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim
index d58335e82..7378520e3 100644
--- a/lib/pure/osproc.nim
+++ b/lib/pure/osproc.nim
@@ -175,7 +175,11 @@ proc startCmd*(command: string, options: set[ProcessOption] = {
   result = startProcess(command=command, options=options + {poEvalCommand})
 
 proc close*(p: Process) {.rtl, extern: "nosp$1", tags: [].}
-  ## When the process has finished executing, cleanup related handles
+  ## When the process has finished executing, cleanup related handles.
+  ##
+  ## **Warning:** If the process has not finished executing, this will forcibly
+  ## terminate the process. Doing so may result in zombie processes and
+  ## `pty leaks <http://stackoverflow.com/questions/27021641/how-to-fix-request-failed-on-channel-0>`_.
 
 proc suspend*(p: Process) {.rtl, extern: "nosp$1", tags: [].}
   ## Suspends the process `p`.