User: james
Date: 05/02/04 05:06:57
Modified: xemacs/src ChangeLog process-unix.c
Log:
Thanks to David Evers, the dreaded email truncation bug should now be gone.
See the xemacs-patches message with ID <ps3bwdnf8i.fsf(a)diannao.ittc.ku.edu>.
Revision Changes Path
1.789 +5 -0 XEmacs/xemacs/src/ChangeLog
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.788
retrieving revision 1.789
diff -u -b -r1.788 -r1.789
--- ChangeLog 2005/02/04 03:01:19 1.788
+++ ChangeLog 2005/02/04 04:06:23 1.789
@@ -1,3 +1,8 @@
+2005-02-03 David Evers <extsw(a)appliedgenerics.com>
+
+ * process-unix.c (unix_send_process): Flush the last chunk, even
+ when the pipe is blocked.
+
2005-02-03 Ben Wing <ben(a)xemacs.org>
* dumper.c:
1.57 +28 -18 XEmacs/xemacs/src/process-unix.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: process-unix.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process-unix.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- process-unix.c 2005/01/24 23:34:05 1.56
+++ process-unix.c 2005/02/04 04:06:34 1.57
@@ -1511,29 +1511,37 @@
Ibyte chunkbuf[512];
Bytecount chunklen;
- while (1)
+ do
{
int writeret;
chunklen = Lstream_read (lstream, chunkbuf, 512);
- if (chunklen <= 0)
- break; /* perhaps should ABORT() if < 0?
- This should never happen. */
old_sigpipe =
(SIGTYPE (*) (int)) EMACS_SIGNAL (SIGPIPE, send_process_trap);
+ if (chunklen > 0)
+ {
+ int save_errno;
+
/* Lstream_write() will never successfully write less than
the amount sent in. In the worst case, it just buffers
the unwritten data. */
- writeret = Lstream_write (XLSTREAM (DATA_OUTSTREAM (p)), chunkbuf,
+ writeret = Lstream_write (XLSTREAM (DATA_OUTSTREAM(p)), chunkbuf,
chunklen);
- {
- int save_errno = errno;
+ save_errno = errno;
EMACS_SIGNAL (SIGPIPE, old_sigpipe);
errno = save_errno;
if (writeret < 0)
/* This is a real error. Blocking errors are handled
specially inside of the filedesc stream. */
- report_process_error ("writing to process", proc);
+ report_file_error ("writing to process", list1 (proc));
+ }
+ else
+ {
+ /* Need to make sure that everything up to and including the
+ last chunk is flushed, even when the pipe is currently
+ blocked. */
+ Lstream_flush (XLSTREAM (DATA_OUTSTREAM(p)));
+ EMACS_SIGNAL (SIGPIPE, old_sigpipe);
}
while (Lstream_was_blocked_p (XLSTREAM (p->pipe_outstream)))
{
@@ -1549,7 +1557,9 @@
Lstream_flush (XLSTREAM (p->pipe_outstream));
EMACS_SIGNAL (SIGPIPE, old_sigpipe);
}
+ /* Perhaps should ABORT() if < 0? This should never happen. */
}
+ while (chunklen > 0);
}
else
{ /* We got here from a longjmp() from the SIGPIPE handler */