From: Eric Sandeen Date: Tue, 22 Sep 2009 15:22:57 +0000 (-0500) Subject: xfs_fsr: fix test for short write X-Git-Tag: v3.0.4~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=431ec4e6b1a6f1007098abd3b138da2a0758c7ae;p=thirdparty%2Fxfsprogs-dev.git xfs_fsr: fix test for short write 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 Reviewed-by: Christoph Hellwig --- diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 9f2bf24c7..253a55d90 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -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"),