Linux-ext4 Archive mirror
 help / color / mirror / Atom feed
From: Jakub Wilk <jwilk@jwilk.net>
To: Theodore Ts'o <tytso@mit.edu>
Cc: <linux-ext4@vger.kernel.org>
Subject: [PATCH e2fsprogs] e4crypt: fix spurious "Success" error message
Date: Wed, 27 Dec 2023 09:08:05 +0100	[thread overview]
Message-ID: <20231227080805.6801-1-jwilk@jwilk.net> (raw)

Before:

    # e4crypt set_policy 0000000000000000 /dev/null
    /dev/null is not a directory
    /dev/null: Success

After:

    # e4crypt set_policy 0000000000000000 /dev/null
    /dev/null: Not a directory

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
---
 misc/e4crypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/e4crypt.c b/misc/e4crypt.c
index 67d25d88..af907041 100644
--- a/misc/e4crypt.c
+++ b/misc/e4crypt.c
@@ -144,7 +144,7 @@ static void validate_paths(int argc, char *argv[], int path_start_index)
 		if (ret < 0)
 			goto invalid;
 		if (!S_ISDIR(st.st_mode)) {
-			fprintf(stderr, "%s is not a directory\n", argv[x]);
+			errno = ENOTDIR;
 			goto invalid;
 		}
 	}
-- 
2.39.2


             reply	other threads:[~2023-12-27  8:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-27  8:08 Jakub Wilk [this message]
2024-04-18 14:39 ` [PATCH e2fsprogs] e4crypt: fix spurious "Success" error message 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=20231227080805.6801-1-jwilk@jwilk.net \
    --to=jwilk@jwilk.net \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).