linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] filefrag: fix minor issues with 29758d2
@ 2014-05-29 17:25 Eric Sandeen
  2014-05-29 17:29 ` Eric Sandeen
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Eric Sandeen @ 2014-05-29 17:25 UTC (permalink / raw)
  To: ext4 development; +Cc: Andreas Dilger

29758d2 filefrag: exit with error code if an error is hit

introduced a couple errors; in one case it missed returning
a value, and in the other used a test where it needed an
assignment.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/misc/filefrag.c b/misc/filefrag.c
index 37c4416..b2826ad 100644
--- a/misc/filefrag.c
+++ b/misc/filefrag.c
@@ -387,8 +387,9 @@ static int frag_report(const char *filename)
 	if (last_device != st.st_dev) {
 		if (fstatfs(fd, &fsinfo) < 0) {
 			close(fd);
+			rc = -errno;
 			perror("fstatfs");
-			return;
+			return rc;
 		}
 		if (verbose)
 			printf("Filesystem type is: %lx\n",
@@ -556,7 +557,7 @@ int main(int argc, char**argv)
 		int rc2 = frag_report(*cpp);
 
 		if (rc2 < 0 && rc == 0)
-			rc == rc2;
+			rc = rc2;
 	}
 
 	return rc;


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-02  1:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-29 17:25 [PATCH] filefrag: fix minor issues with 29758d2 Eric Sandeen
2014-05-29 17:29 ` Eric Sandeen
2014-05-29 17:34 ` Lukáš Czerner
2014-05-29 17:42   ` Eric Sandeen
2014-05-29 17:40 ` [PATCH V2] filefrag: fix " Eric Sandeen
2014-05-30  6:45   ` Andreas Dilger
2014-05-30 18:10 ` [PATCH V3] filefrag: " Eric Sandeen
2014-05-30 21:03   ` Andreas Dilger
2014-06-02  1:28     ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).