The following commit has been merged in the master branch:
commit 39a535646fe17f4f9d9db88295e406443d1bc40a
Author: Guillem Jover <[email protected]>
Date:   Tue May 10 10:14:40 2011 +0200

    libdpkg: Move ohshite calls into the buffer_copy loop

diff --git a/lib/dpkg/buffer.c b/lib/dpkg/buffer.c
index f0cf91f..2d053c0 100644
--- a/lib/dpkg/buffer.c
+++ b/lib/dpkg/buffer.c
@@ -193,7 +193,7 @@ buffer_copy(struct buffer_data *read_data,
        while (bufsize > 0) {
                bytesread = buffer_read(read_data, buf, bufsize);
                if (bytesread < 0)
-                       break;
+                       ohshite(_("failed to read on buffer copy for %s"), 
desc);
                if (bytesread == 0)
                        break;
 
@@ -209,17 +209,13 @@ buffer_copy(struct buffer_data *read_data,
 
                byteswritten = buffer_write(write_data, buf, bytesread);
                if (byteswritten < 0)
-                       break;
+                       ohshite(_("failed in write on buffer copy for %s"), 
desc);
                if (byteswritten == 0)
                        break;
 
                totalwritten += byteswritten;
        }
 
-       if (bytesread < 0)
-               ohshite(_("failed to read on buffer copy for %s"), desc);
-       if (byteswritten < 0)
-               ohshite(_("failed in write on buffer copy for %s"), desc);
        if (limit > 0)
                ohshit(_("short read on buffer copy for %s"), desc);
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to