From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Jonas Rebmann <jre@pengutronix.de>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] common: binfmt: replace generic ENOENT message with "Command not found"
Date: Fri, 26 Sep 2025 11:01:00 +0200 [thread overview]
Message-ID: <20250926090102.915685-1-a.fatoum@pengutronix.de> (raw)
A message like
tlv: No such file or directory
can mean either tlv command is missing or it returned -ENOENT.
Let's differentiate between these two situations, so the former becomes:
tlv: No such command
Reported-by: Jonas Rebmann <jre@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
common/binfmt.c | 4 ++--
common/misc.c | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/common/binfmt.c b/common/binfmt.c
index 6a1e9fc83e34..1d5035535581 100644
--- a/common/binfmt.c
+++ b/common/binfmt.c
@@ -30,7 +30,7 @@ static int binfmt_run(char *file, int argc, char **argv)
if (ret != -ERESTARTNOHAND)
return ret;
}
- return -ENOENT;
+ return -ENOIOCTLCMD;
}
/*
@@ -73,7 +73,7 @@ int execute_binfmt(int argc, char **argv)
return ret;
}
- return -ENOENT;
+ return -ENOIOCTLCMD;
}
int binfmt_register(struct binfmt_hook *b)
diff --git a/common/misc.c b/common/misc.c
index 2ee6fdd7d612..0af5a9cf30cd 100644
--- a/common/misc.c
+++ b/common/misc.c
@@ -60,6 +60,7 @@ const char *strerror(int errnum)
case ELOOP : return "Too many symbolic links encountered";
case ENODATA : return "No data available";
case EOPNOTSUPP : return "Operation not supported";
+ case ENOIOCTLCMD : return "Command not found";
#if 0 /* These are probably not needed */
case ENOTBLK : return "Block device required";
case EFBIG : return "File too large";
--
2.47.3
next reply other threads:[~2025-09-26 9:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 9:01 Ahmad Fatoum [this message]
2025-09-26 11:37 ` Sascha Hauer
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=20250926090102.915685-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jre@pengutronix.de \
/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