mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 19:36:18 +01:00
gspawn: Don’t use g_close() in async-signal-safe context
Use normal `close()` instead, which is guaranteed to be async-signal-safe. See `man 7 signal-safety`. Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #2140
This commit is contained in:
parent
0e05ef7750
commit
6f46294227
@ -155,6 +155,7 @@ extern char **environ;
|
||||
*/
|
||||
|
||||
|
||||
static gint safe_close (gint fd);
|
||||
|
||||
static gint g_execute (const gchar *file,
|
||||
gchar **argv,
|
||||
@ -273,8 +274,7 @@ close_and_invalidate (gint *fd)
|
||||
return;
|
||||
else
|
||||
{
|
||||
/* FIXME: g_close() is not async-signal-safe on failure. */
|
||||
(void) g_close (*fd, NULL);
|
||||
safe_close (*fd);
|
||||
*fd = -1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user