From faa6ce91bf537fbb13931e2dd54c11dc06038d65 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 1 Mar 2007 10:18:25 +0000 Subject: [PATCH] (send_process_object): Check the process status and signal an error if something is wrong. --- src/ChangeLog | 5 +++++ src/process.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b2b2bf22360..afb6ce8b7b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-03-01 Kenichi Handa + + * process.c (send_process_object): Check the process status and + signal an error if something is wrong. + 2007-02-28 Chong Yidong * insdel.c (Fcombine_after_change_execute): Return nil if diff --git a/src/process.c b/src/process.c index 7f651e36700..78fc400e5a2 100644 --- a/src/process.c +++ b/src/process.c @@ -5694,8 +5694,16 @@ send_process_object (proc, start, end) : ! NILP (XBUFFER (object)->enable_multibyte_characters)) { struct Lisp_Process *p = XPROCESS (proc); - struct coding_system *coding = proc_encode_coding_system[XINT (p->outfd)]; + struct coding_system *coding; + if (p->raw_status_new) + update_status (p); + if (! EQ (p->status, Qrun)) + error ("Process %s not running", SDATA (p->name)); + if (XINT (p->outfd) < 0) + error ("Output file descriptor of %s is closed", SDATA (p->name)); + + coding = proc_encode_coding_system[XINT (p->outfd)]; if (! EQ (coding->symbol, p->encode_coding_system)) /* The coding system for encoding was changed to raw-text because we sent a unibyte text previously. Now we are -- 2.39.2