mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] common: binfmt: replace generic ENOENT message with "Command not found"
@ 2025-09-26  9:01 Ahmad Fatoum
  2025-09-26 11:37 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-09-26  9:01 UTC (permalink / raw)
  To: barebox; +Cc: Jonas Rebmann, Ahmad Fatoum

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




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

* Re: [PATCH] common: binfmt: replace generic ENOENT message with "Command not found"
  2025-09-26  9:01 [PATCH] common: binfmt: replace generic ENOENT message with "Command not found" Ahmad Fatoum
@ 2025-09-26 11:37 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-09-26 11:37 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum; +Cc: Jonas Rebmann


On Fri, 26 Sep 2025 11:01:00 +0200, Ahmad Fatoum wrote:
> 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:
> 
> [...]

Applied, thanks!

[1/1] common: binfmt: replace generic ENOENT message with "Command not found"
      https://git.pengutronix.de/cgit/barebox/commit/?id=eb8063890544 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2025-09-26 11:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-26  9:01 [PATCH] common: binfmt: replace generic ENOENT message with "Command not found" Ahmad Fatoum
2025-09-26 11:37 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox