Browse Source

libdpkg: Do not log repeated data when the write call wrote partially

Guillem Jover 17 years ago
parent
commit
40ceeb6688
3 changed files with 7 additions and 1 deletions
  1. 5 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 1 1
      lib/log.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-12-23  Guillem Jover  <guillem@debian.org>
+
+	* lib/log.c (statusfd_send): Pass to write the remaining data, not
+	the same initial buffer.
+
 2008-12-08  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/Dpkg/Changelog.pm, scripts/dpkg-buildpackage.pl,

+ 1 - 0
debian/changelog

@@ -38,6 +38,7 @@ dpkg (1.15.0) UNRELEASED; urgency=low
   * Unmark dselect debug messages for translation.
   * Use a the warning function to uniformly print all warning messages.
   * Properly use internerr to report about programming bugs.
+  * Do not log repeated strings when the write call wrote partial data.
 
   [ Raphael Hertzog ]
   * Enhance dpkg-shlibdeps's error message when a library can't be found to

+ 1 - 1
lib/log.c

@@ -94,7 +94,7 @@ statusfd_send(const char *fmt, ...)
 
 	for (pipef = status_pipes; pipef; pipef = pipef->next) {
 		for (p = vb.buf, l = vb.used; l;  p += r, l -= r) {
-			r = write(pipef->fd, vb.buf, vb.used);
+			r = write(pipef->fd, p, l);
 			if (r < 0)
 				ohshite(_("unable to write to status fd %d"),
 				        pipef->fd);