1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

Utilities: Fix return value of expr

This commit is contained in:
Jean-Baptiste Boric 2021-07-08 18:04:15 +02:00 committed by Andreas Kling
parent 897a706075
commit 3db1681214

View file

@ -31,7 +31,7 @@ template<typename Fmt, typename... Args>
warn("ERROR: \e[31m"); warn("ERROR: \e[31m");
warnln(StringView { fmt }, args...); warnln(StringView { fmt }, args...);
warn("\e[0m"); warn("\e[0m");
exit(1); exit(2);
} }
class Expression { class Expression {
@ -569,12 +569,12 @@ int main(int argc, char** argv)
{ {
if (pledge("stdio", nullptr) < 0) { if (pledge("stdio", nullptr) < 0) {
perror("pledge"); perror("pledge");
return 1; return 3;
} }
if (unveil(nullptr, nullptr) < 0) { if (unveil(nullptr, nullptr) < 0) {
perror("unveil"); perror("unveil");
return 1; return 3;
} }
if ((argc == 2 && "--help"sv == argv[1]) || argc == 1) if ((argc == 2 && "--help"sv == argv[1]) || argc == 1)
@ -596,5 +596,5 @@ int main(int argc, char** argv)
outln("{}", expression->string()); outln("{}", expression->string());
break; break;
} }
return 0; return expression->truth() ? 0 : 1;
} }