mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-24 19:18:15 +02:00
Between fork() and exec() in the child process it is only safe to use async-signal-safe functions. Surprisingly, snprintf() is not such function. See e.g. https://stackoverflow.com/a/6771799 and how snprintf is not listed in signal-safety(7) manual. Therefore we must prepare the fd argument strings before fork(). That is only possible if we also do not dup() fd in the child process. Hence we remove the close-on-exec flag instead in the child process which has copies of the parent's file descriptors. Fortunately fcntl() is safe. struct fdstr is helping to reduce code clutter a bit. Additionally, if fork() fails, we now clean up the fds we created. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com> |
||
|---|---|---|
| .. | ||
| cms-colord.c | ||
| cms-helper.c | ||
| cms-helper.h | ||
| cms-static.c | ||
| executable.c | ||
| main.c | ||
| meson.build | ||
| screen-share.c | ||
| systemd-notify.c | ||
| text-backend.c | ||
| weston-private.h | ||
| weston-screenshooter.c | ||
| weston.desktop | ||
| weston.h | ||
| xwayland.c | ||