Function: eshell-close-handle

eshell-close-handle is a byte-compiled function defined in esh-io.el.gz.

Signature

(eshell-close-handle HANDLE STATUS)

Documentation

Close a single HANDLE, taking refcounts into account.

This will pass STATUS to each target for the handle, which should be a non-nil value on successful termination.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-io.el.gz
(defun eshell-close-handle (handle status)
  "Close a single HANDLE, taking refcounts into account.
This will pass STATUS to each target for the handle, which should
be a non-nil value on successful termination."
  (when handle
    (cl-assert (> (cdar handle) 0)
               "Attempted to close a handle with 0 references")
    (when (and (> (cdar handle) 0)
               (= (decf (cdar handle)) 0))
      (dolist (target (caar handle))
        (eshell-close-target target status))
      (setcar (car handle) nil))))