mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-01 21:33:09 +02: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,
|
static gint g_execute (const gchar *file,
|
||||||
gchar **argv,
|
gchar **argv,
|
||||||
@ -273,8 +274,7 @@ close_and_invalidate (gint *fd)
|
|||||||
return;
|
return;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* FIXME: g_close() is not async-signal-safe on failure. */
|
safe_close (*fd);
|
||||||
(void) g_close (*fd, NULL);
|
|
||||||
*fd = -1;
|
*fd = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user