mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
QuickShow: Disown child process after spawning
This commit is contained in:
parent
46ab006c58
commit
27d3971ba6
Notes:
sideshowbarker
2024-07-19 04:19:19 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/27d3971ba6d
1 changed files with 7 additions and 1 deletions
|
@ -44,6 +44,7 @@
|
|||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <serenity.h>
|
||||
#include <spawn.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -114,7 +115,12 @@ int main(int argc, char** argv)
|
|||
pid_t child;
|
||||
for (size_t i = 1; i < urls.size(); ++i) {
|
||||
const char* argv[] = { "/bin/QuickShow", urls[i].path().characters(), nullptr };
|
||||
posix_spawn(&child, "/bin/QuickShow", nullptr, nullptr, const_cast<char**>(argv), environ);
|
||||
if ((errno = posix_spawn(&child, "/bin/QuickShow", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
} else {
|
||||
if (disown(child) < 0)
|
||||
perror("disown");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue