]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_fsr: fix test for short write
authorEric Sandeen <sandeen@sandeen.net>
Tue, 22 Sep 2009 15:22:57 +0000 (10:22 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 22 Sep 2009 15:22:57 +0000 (10:22 -0500)
Clang found this one too, as a dead nested assignment.

The point is to see if we write all the bytes; but the initial
assignment is backwards.  It's safe in the end, because if they
weren't already equal anyway, we'd have exited prior to this, but
it's worth fixing up for clarity.

Signed-of-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fsr/xfs_fsr.c

index 9f2bf24c791b0dd56390dc345fd7b824e2650f9c..253a55d909c34bad8d65fbeef6a217aa8a77a0a3 100644 (file)
@@ -1190,7 +1190,7 @@ packfile(char *fname, char *tname, int fd,
                        }
                        if (nfrags) {
                                /* Do a matching write to the tmp file */
-                               wc = wc_b4;
+                               wc_b4 = wc;
                                if (((wc = write(ffd, fbuf, wc)) != wc_b4)) {
                                        fsrprintf(_("bad write of %d bytes "
                                                "to %s: %s\n"),