mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:17:35 +00:00
wc: Use pledge()
This commit is contained in:
parent
257e7f022a
commit
7ce3f218af
1 changed files with 10 additions and 0 deletions
|
@ -122,6 +122,11 @@ Count get_total_count(Vector<Count>& counts)
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
if (pledge("stdio rpath", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
Vector<const char*> files;
|
Vector<const char*> files;
|
||||||
|
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
|
@ -140,6 +145,11 @@ int main(int argc, char** argv)
|
||||||
counts.append(count);
|
counts.append(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pledge("stdio", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (files.size() > 1) {
|
if (files.size() > 1) {
|
||||||
Count total_count = get_total_count(counts);
|
Count total_count = get_total_count(counts);
|
||||||
counts.append(total_count);
|
counts.append(total_count);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue