mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
gfile: Ensure we create internal pipe with FD_CLOEXEC
That way the descriptors aren't leaked to child processes. https://bugzilla.gnome.org/show_bug.cgi?id=692544
This commit is contained in:
parent
cbd7225e70
commit
48fd507012
11
gio/gfile.c
11
gio/gfile.c
@ -46,6 +46,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gfile.h"
|
#include "gfile.h"
|
||||||
|
#ifdef G_OS_UNIX
|
||||||
|
#include "glib-unix.h"
|
||||||
|
#endif
|
||||||
#include "gvfs.h"
|
#include "gvfs.h"
|
||||||
#include "gtask.h"
|
#include "gtask.h"
|
||||||
#include "gfileattribute-priv.h"
|
#include "gfileattribute-priv.h"
|
||||||
@ -2850,12 +2853,8 @@ splice_stream_with_progress (GInputStream *in,
|
|||||||
fd_in = g_file_descriptor_based_get_fd (G_FILE_DESCRIPTOR_BASED (in));
|
fd_in = g_file_descriptor_based_get_fd (G_FILE_DESCRIPTOR_BASED (in));
|
||||||
fd_out = g_file_descriptor_based_get_fd (G_FILE_DESCRIPTOR_BASED (out));
|
fd_out = g_file_descriptor_based_get_fd (G_FILE_DESCRIPTOR_BASED (out));
|
||||||
|
|
||||||
if (pipe (buffer) != 0)
|
if (!g_unix_open_pipe (buffer, FD_CLOEXEC, error))
|
||||||
{
|
return FALSE;
|
||||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
|
||||||
"Pipe creation failed");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
total_size = -1;
|
total_size = -1;
|
||||||
/* avoid performance impact of querying total size when it's not needed */
|
/* avoid performance impact of querying total size when it's not needed */
|
||||||
|
Loading…
Reference in New Issue
Block a user