]> www.infradead.org Git - mtd-utils.git/commit
fs-tests: integck: prefer to check for success
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 13 Apr 2011 11:27:34 +0000 (14:27 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 18 Apr 2011 14:44:45 +0000 (17:44 +0300)
commit711217f8e63fc7cf23e1e2859d2621eab4886754
tree9f267d1e4a3f10246b423d9ae13a78cbf9c0ebd6
parent822807fa352157ddf5bd4a94b96733a627420f32
fs-tests: integck: prefer to check for success

Many of standard C libraries return 0 on success and -1 on failure.
Currently integck mostly checks for failure by comparing with -1, like:

CHECK(fsync(fd) != -1) /* Don't die if not failure */

but in some places the check is like

CHECK(fsync(fd) == 0) /* Don't die if success */

This patch harmonizes this an makes integck to use the second style
which seems to be more logical. Besides, the binary is smaller in
this case:

[dedekind@eru fs-tests (master)]$ size integrity/integck-old
   text    data     bss     dec     hex filename
  44677    1200   37408   83285   14555 integrity/integck
[dedekind@eru fs-tests (master)]$ size integrity/integck-new
   text    data     bss     dec     hex filename
  44661    1200   37408   83269   14545 integrity/integck

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
tests/fs-tests/integrity/integck.c