From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: SIGPIPE in server Date: Sun, 03 Oct 2004 20:20:12 +0900 (JST) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <20041003.202012.92555698.jet@gyve.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1096802597 18709 80.91.229.6 (3 Oct 2004 11:23:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 3 Oct 2004 11:23:17 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 03 13:22:58 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CE4SA-0004t7-00 for ; Sun, 03 Oct 2004 13:22:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CE4Yh-0002Qi-6R for ged-emacs-devel@m.gmane.org; Sun, 03 Oct 2004 07:29:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CE4YZ-0002Pc-AC for emacs-devel@gnu.org; Sun, 03 Oct 2004 07:29:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CE4YY-0002Ox-Ig for emacs-devel@gnu.org; Sun, 03 Oct 2004 07:29:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CE4YY-0002Ou-D2 for emacs-devel@gnu.org; Sun, 03 Oct 2004 07:29:34 -0400 Original-Received: from [210.130.136.40] (helo=r-maa.spacetown.ne.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CE4Ry-0003Tt-5N for emacs-devel@gnu.org; Sun, 03 Oct 2004 07:22:46 -0400 Original-Received: from localhost (h219-110-074-009.catv01.itscom.jp [219.110.74.9]) by r-maa.spacetown.ne.jp (8.11.6) with ESMTP id i93BMgq28855 for ; Sun, 3 Oct 2004 20:22:42 +0900 (JST) Original-To: emacs-devel@gnu.org X-Mailer: Mew version 4.0.62 on Emacs 21.3.50 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27824 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27824 Hi, I'm using following command line to use emacs over ssh connection: emacsclient -n -d localhost:10 --eval '(make-frame-on-display "localhost:10")' It almost works fine. However, I get following error(Newline is inserted by my hand.): Debugger entered--Lisp error: (error "SIGPIPE raised on process server <*1*>; closed it") process-send-region(#> 1 47) server-process-filter(#> "-nowait -eval -display localhost:10 (make-frame-on-display&_\"localhost:10\") \n") It seems that `process-send-region' gets SIGPIPE because -n(--no-wait) option make the process dead quickly. The next patch suppresses the error with `condition-case'. Question is what I should do after receiving the error. In the patch, the error is just reported by `message'. Is this OK? Regards, Masatake YAMATO 2004-10-03 Masatake YAMATO * server.el (server-process-filter): Wrap `process-send-region' by `condition-case' to guard the case when the pipe to PROC is closed. Index: lisp/server.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/server.el,v retrieving revision 1.97 diff -u -r1.97 server.el --- lisp/server.el 19 Mar 2004 00:50:48 -0000 1.97 +++ lisp/server.el 3 Oct 2004 11:14:52 -0000 @@ -343,7 +343,11 @@ (with-temp-buffer (let ((standard-output (current-buffer))) (pp v) - (process-send-region proc (point-min) (point-max)))))) + ;; Guard the case when the pipe to PROC is closed. + (condition-case err + (process-send-region proc (point-min) (point-max)) + (file-error (message "Ignore `file-error': %S" (cdr err)))) + )))) ;; ARG is a file name. ;; Collapse multiple slashes to single slashes. (setq arg (command-line-normalize-file-name arg))