mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibC+LibPthread: Permit partial pthread_atfork
POSIX explicitly allows providing nullptr's, and our __pthread_*() implementation stores and calls the provided functions as-is, without checking for nullptr.
This commit is contained in:
parent
fbb85f9b2f
commit
cf0d4994c2
1 changed files with 6 additions and 3 deletions
|
@ -900,9 +900,12 @@ int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int)
|
|||
|
||||
int pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void))
|
||||
{
|
||||
__pthread_fork_atfork_register_prepare(prepare);
|
||||
__pthread_fork_atfork_register_parent(parent);
|
||||
__pthread_fork_atfork_register_child(child);
|
||||
if (prepare)
|
||||
__pthread_fork_atfork_register_prepare(prepare);
|
||||
if (parent)
|
||||
__pthread_fork_atfork_register_parent(parent);
|
||||
if (child)
|
||||
__pthread_fork_atfork_register_child(child);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue