mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00:00
Shell: Simply print "cmd: Command not found." for ENOENT on execution.
This looks a little nicer than 'execvp(cmd): No such file or directory'
This commit is contained in:
parent
f186c018f1
commit
7c3b2e0728
1 changed files with 4 additions and 1 deletions
|
@ -463,7 +463,10 @@ static int run_command(const String& cmd)
|
||||||
|
|
||||||
int rc = execvp(argv[0], const_cast<char* const*>(argv.data()));
|
int rc = execvp(argv[0], const_cast<char* const*>(argv.data()));
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
fprintf(stderr, "execvp(%s): %s\n", argv[0], strerror(errno));
|
if (errno == ENOENT)
|
||||||
|
fprintf(stderr, "%s: Command not found.\n", argv[0]);
|
||||||
|
else
|
||||||
|
fprintf(stderr, "execvp(%s): %s\n", argv[0], strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue