mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 13:35:12 +00:00
cat: Use pledge()
This commit is contained in:
parent
1934a1ec0b
commit
e131a401e8
Notes:
sideshowbarker
2024-07-19 10:10:45 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e131a401e89
1 changed files with 11 additions and 0 deletions
|
@ -9,6 +9,11 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vector<int> fds;
|
||||
if (argc > 1) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
|
@ -22,6 +27,12 @@ int main(int argc, char** argv)
|
|||
} else {
|
||||
fds.append(0);
|
||||
}
|
||||
|
||||
if (pledge("stdio", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (auto& fd : fds) {
|
||||
for (;;) {
|
||||
char buf[32768];
|
||||
|
|
Loading…
Add table
Reference in a new issue