svn commit: trunk/busybox/printutils

vda at busybox.net vda at busybox.net
Tue Feb 26 20:23:03 UTC 2008


Author: vda
Date: 2008-02-26 12:23:02 -0800 (Tue, 26 Feb 2008)
New Revision: 21119

Log:
lpr: fflush stdout fix



Modified:
   trunk/busybox/printutils/lpr.c


Changeset:
Modified: trunk/busybox/printutils/lpr.c
===================================================================
--- trunk/busybox/printutils/lpr.c	2008-02-26 20:13:52 UTC (rev 21118)
+++ trunk/busybox/printutils/lpr.c	2008-02-26 20:23:02 UTC (rev 21119)
@@ -130,6 +130,7 @@
 			cmd = (opts & LPQ_SHORT_FMT) ? 3 : 4;
  command:
 			printf("%c" "%s\n", cmd, queue);
+			fflush(stdout);
 			bb_copyfd_eof(STDOUT_FILENO, old_stdout);
 		}
 
@@ -225,6 +226,7 @@
 		st.st_size = 0; /* paranoia: fstat may theoretically fail */
 		fstat(fd, &st);
 		printf("\x3" "%"OFF_FMT"u d%s\n", st.st_size, remote_filename);
+		fflush(stdout);
 		if (bb_copyfd_size(fd, STDOUT_FILENO, st.st_size) != st.st_size) {
 			// We're screwed. We sent less bytes than we advertised.
 			bb_error_msg_and_die("local file changed size?!");




More information about the busybox-cvs mailing list