all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Race condition in eshell-gather-process-output
@ 2013-01-19 11:28 Jürgen Hötzel
  2013-01-19 12:16 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Jürgen Hötzel @ 2013-01-19 11:28 UTC (permalink / raw)
  To: emacs-devel

Hi,

I stumbled across this while debugging eshell/tramp external commands:

In eshell-gather-process-output the external process is started using
start-file-process:

      (setq proc
	    (let ((process-connection-type
		   (unless (eshell-needs-pipe-p command)
		     process-connection-type))
		  (command (or (file-remote-p command 'localname) command)))
	      (apply 'start-file-process
		     (file-name-nondirectory command) nil
		     ;; `start-process' can't deal with relative filenames.
		     (append (list (expand-file-name command)) args))))
----------------------------------------------------------------------------------------
something can happen meanwhile: The process may have written
output (nil output buffer)
----------------------------------------------------------------------------------------

      (eshell-record-process-object proc)
      (set-process-buffer proc (current-buffer))

^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Maybe too late to set output buffer!

Why is the output buffer not set directly:

(apply 'start-file-process
		     (file-name-nondirectory command) (current-buffer)
		     ...)

Regards,

Jürgen



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-19 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-19 11:28 Race condition in eshell-gather-process-output Jürgen Hötzel
2013-01-19 12:16 ` Andreas Schwab
2013-01-19 12:31   ` Jürgen Hötzel
2013-01-19 15:58     ` Andreas Schwab

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.