summaryrefslogtreecommitdiff
path: root/Services/Taskbar
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@serenityos.org>2020-05-26 13:52:42 +0300
committerAndreas Kling <kling@serenityos.org>2020-05-26 14:35:10 +0200
commit4139838a936ab6dc9325baa912232432fb66c82d (patch)
treea107e8c221b22cf471285ed461f9b8ac0a57e0c3 /Services/Taskbar
parentcddaeb43d31304a5cb7ccdf8cf08a2bdbfff84cf (diff)
downloadserenity-4139838a936ab6dc9325baa912232432fb66c82d.zip
Userland et al: Pledge sigaction when needed
* In some cases, we can first call sigaction()/signal(), then *not* pledge sigaction. * In other cases, we pledge sigaction at first, call sigaction()/signal() second, then pledge again, this time without sigaction. * In yet other cases, we keep the sigaction pledge. I suppose these could all be migrated to drop it or not pledge it at all, if somebody is interested in doing that.
Diffstat (limited to 'Services/Taskbar')
-rw-r--r--Services/Taskbar/main.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Services/Taskbar/main.cpp b/Services/Taskbar/main.cpp
index 33b96cb465..5287515c1c 100644
--- a/Services/Taskbar/main.cpp
+++ b/Services/Taskbar/main.cpp
@@ -32,13 +32,18 @@
int main(int argc, char** argv)
{
- if (pledge("stdio shared_buffer accept proc exec rpath unix cpath fattr", nullptr) < 0) {
+ if (pledge("stdio shared_buffer accept proc exec rpath unix cpath fattr sigaction", nullptr) < 0) {
perror("pledge");
return 1;
}
GUI::Application app(argc, argv);
+ signal(SIGCHLD, [](int signo) {
+ (void)signo;
+ wait(nullptr);
+ });
+
if (pledge("stdio shared_buffer accept proc exec rpath", nullptr) < 0) {
perror("pledge");
return 1;
@@ -47,10 +52,5 @@ int main(int argc, char** argv)
TaskbarWindow window;
window.show();
- signal(SIGCHLD, [](int signo) {
- (void)signo;
- wait(nullptr);
- });
-
return app.exec();
}