public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Subject: [PATCH 2/3] e2fsck: don't print errcode if the errcode is 0
Date: Thu,  4 Feb 2021 15:36:00 -0800	[thread overview]
Message-ID: <20210204233601.2369470-2-harshads@google.com> (raw)
In-Reply-To: <20210204233601.2369470-1-harshads@google.com>

From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>

We print the error message corresponding to errcode while converting
errcode to errno. Don't do that if errcode is 0.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
---
 e2fsck/journal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index b1ca485c..922c252d 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -383,7 +383,9 @@ out_err:
 
 static int __errcode_to_errno(errcode_t err, const char *func, int line)
 {
-	fprintf(stderr, "Error \"%s\" encountered in %s at line %d\n",
+	if (err == 0)
+		return 0;
+	fprintf(stderr, "Error \"%s\" encountered in function %s at line %d\n",
 		error_message(err), func, line);
 	if (err <= 256)
 		return -err;
-- 
2.30.0.365.g02bc693789-goog


  reply	other threads:[~2021-02-04 23:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 23:35 [PATCH 1/3] ext2fs: initialize handle to NULL in ext2fs_count_blks Harshad Shirwadkar
2021-02-04 23:36 ` Harshad Shirwadkar [this message]
2021-02-09  4:48   ` [PATCH 2/3] e2fsck: don't print errcode if the errcode is 0 Theodore Ts'o
2021-02-04 23:36 ` [PATCH 3/3] e2fsck: endianness fixes for fast commit replay Harshad Shirwadkar
2021-02-09  4:49   ` Theodore Ts'o
2021-02-09  4:47 ` [PATCH 1/3] ext2fs: initialize handle to NULL in ext2fs_count_blks Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210204233601.2369470-2-harshads@google.com \
    --to=harshadshirwadkar@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox