casaroli commented on code in PR #21454:
URL: https://github.com/apache/nuttx/pull/21454#discussion_r4471267919
##########
binfmt/builtin.c:
##########
@@ -76,24 +78,27 @@ static int builtin_loadbinary(FAR struct binary_s *binp,
int nexports)
{
FAR const struct builtin_s *builtin;
- FAR char *name;
+ FAR const char *name;
+ struct stat buf;
int ret;
binfo("Loading file: %s\n", filename);
name = strrchr(filename, '/');
- if (name != NULL)
- {
- filename = name + 1;
- }
+ name = name != NULL ? name + 1 : filename;
/* Looking up the index to this name in g_builtins[] */
- ret = builtin_isavail(filename);
+ ret = builtin_isavail(name);
if (ret < 0)
{
- berr("ERROR: %s is not a builtin application\n", filename);
- return ret;
+ /* Not mine: -ENOEXEC for a file that exists, as in the other handlers;
+ * -ENOENT only for a file that is not there.
+ */
+
+ binfo("%s is not a builtin application\n", name);
+ ret = nx_stat(filename, &buf, 1);
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]