man: Use pledge()

This commit is contained in:
Brian Gianforcaro 2020-01-12 16:32:01 -08:00 committed by Andreas Kling
parent f7148c766a
commit 1915151116

View file

@ -6,6 +6,11 @@
int main(int argc, char* argv[])
{
if (pledge("stdio rpath", nullptr) < 0) {
perror("pledge");
return 1;
}
String name;
String section;
@ -55,6 +60,12 @@ int main(int argc, char* argv[])
perror("Failed to open man page file");
exit(1);
}
if (pledge("stdio", nullptr) < 0) {
perror("pledge");
return 1;
}
dbg() << "Loading man page from " << file->filename();
auto buffer = file->read_all();
String source { (const char*)buffer.data(), (size_t)buffer.size() };