mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:57:35 +00:00
man: Use pledge()
This commit is contained in:
parent
f7148c766a
commit
1915151116
1 changed files with 11 additions and 0 deletions
|
@ -6,6 +6,11 @@
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
if (pledge("stdio rpath", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
String section;
|
String section;
|
||||||
|
|
||||||
|
@ -55,6 +60,12 @@ int main(int argc, char* argv[])
|
||||||
perror("Failed to open man page file");
|
perror("Failed to open man page file");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pledge("stdio", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
dbg() << "Loading man page from " << file->filename();
|
dbg() << "Loading man page from " << file->filename();
|
||||||
auto buffer = file->read_all();
|
auto buffer = file->read_all();
|
||||||
String source { (const char*)buffer.data(), (size_t)buffer.size() };
|
String source { (const char*)buffer.data(), (size_t)buffer.size() };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue