comparison src/process.c @ 103621:444861df76cd

Simplify last change.
author Andreas Schwab <schwab@linux-m68k.org>
date Sun, 28 Jun 2009 20:25:49 +0000
parents 70e98b9afe06
children 2e99121a6895
comparison
equal deleted inserted replaced
103620:70e98b9afe06 103621:444861df76cd
5548 { 5548 {
5549 /* Use volatile to protect variables from being clobbered by longjmp. */ 5549 /* Use volatile to protect variables from being clobbered by longjmp. */
5550 struct Lisp_Process *p = XPROCESS (proc); 5550 struct Lisp_Process *p = XPROCESS (proc);
5551 int rv; 5551 int rv;
5552 struct coding_system *coding; 5552 struct coding_system *coding;
5553 struct gcpro gcpro1, gcpro2; 5553 struct gcpro gcpro1;
5554 SIGTYPE (*volatile old_sigpipe) (); 5554 SIGTYPE (*volatile old_sigpipe) ();
5555 Lisp_Object dst_object = Qnil; 5555
5556 5556 GCPRO1 (object);
5557 GCPRO2 (object, dst_object);
5558 5557
5559 if (p->raw_status_new) 5558 if (p->raw_status_new)
5560 update_status (p); 5559 update_status (p);
5561 if (! EQ (p->status, Qrun)) 5560 if (! EQ (p->status, Qrun))
5562 error ("Process %s not running", SDATA (p->name)); 5561 error ("Process %s not running", SDATA (p->name));
5631 coding->dst_object = make_unibyte_string (buf, len); 5630 coding->dst_object = make_unibyte_string (buf, len);
5632 coding->produced = len; 5631 coding->produced = len;
5633 } 5632 }
5634 5633
5635 len = coding->produced; 5634 len = coding->produced;
5636 dst_object = coding->dst_object; 5635 object = coding->dst_object;
5637 buf = SDATA (dst_object); 5636 buf = SDATA (object);
5638 } 5637 }
5639 5638
5640 if (pty_max_bytes == 0) 5639 if (pty_max_bytes == 0)
5641 { 5640 {
5642 #if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON) 5641 #if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON)
5763 } 5762 }
5764 #endif /* BROKEN_PTY_READ_AFTER_EAGAIN */ 5763 #endif /* BROKEN_PTY_READ_AFTER_EAGAIN */
5765 5764
5766 /* Running filters might relocate buffers or strings. 5765 /* Running filters might relocate buffers or strings.
5767 Arrange to relocate BUF. */ 5766 Arrange to relocate BUF. */
5768 if (CODING_REQUIRE_ENCODING (coding)) 5767 if (BUFFERP (object))
5769 offset = buf - SDATA (dst_object);
5770 else if (BUFFERP (object))
5771 offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); 5768 offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf);
5772 else if (STRINGP (object)) 5769 else if (STRINGP (object))
5773 offset = buf - SDATA (object); 5770 offset = buf - SDATA (object);
5774 5771
5775 #ifdef EMACS_HAS_USECS 5772 #ifdef EMACS_HAS_USECS
5776 wait_reading_process_output (0, 20000, 0, 0, Qnil, NULL, 0); 5773 wait_reading_process_output (0, 20000, 0, 0, Qnil, NULL, 0);
5777 #else 5774 #else
5778 wait_reading_process_output (1, 0, 0, 0, Qnil, NULL, 0); 5775 wait_reading_process_output (1, 0, 0, 0, Qnil, NULL, 0);
5779 #endif 5776 #endif
5780 5777
5781 if (CODING_REQUIRE_ENCODING (coding)) 5778 if (BUFFERP (object))
5782 buf = offset + SDATA (dst_object);
5783 else if (BUFFERP (object))
5784 buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); 5779 buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset);
5785 else if (STRINGP (object)) 5780 else if (STRINGP (object))
5786 buf = offset + SDATA (object); 5781 buf = offset + SDATA (object);
5787 5782
5788 rv = 0; 5783 rv = 0;