Re: [RFC PATCH] linux-user/syscall: Use g_file_open_tmp()

2020-02-27 Thread Ján Tomko
On a Thursday in 2020, Daniel P. Berrangé wrote: On Thu, Feb 27, 2020 at 11:06:21AM +0100, Philippe Mathieu-Daudé wrote: Use GLib g_file_open_tmp() instead of getenv + snprintf + mkstemp. Signed-off-by: Philippe Mathieu-Daudé --- RFC because I'm not sure g_autoptr(GError) works this way. It

Re: [RFC PATCH] linux-user/syscall: Use g_file_open_tmp()

2020-02-27 Thread Daniel P . Berrangé
On Thu, Feb 27, 2020 at 11:06:21AM +0100, Philippe Mathieu-Daudé wrote: > Use GLib g_file_open_tmp() instead of getenv + snprintf + mkstemp. > > Signed-off-by: Philippe Mathieu-Daudé > --- > RFC because I'm not sure g_autoptr(GError) works this way. It does work. Any struct that's defined in GLi

Re: [RFC PATCH] linux-user/syscall: Use g_file_open_tmp()

2020-02-27 Thread Marc-André Lureau
Hi On Thu, Feb 27, 2020 at 11:06 AM Philippe Mathieu-Daudé wrote: > > Use GLib g_file_open_tmp() instead of getenv + snprintf + mkstemp. > > Signed-off-by: Philippe Mathieu-Daudé > --- > RFC because I'm not sure g_autoptr(GError) works this way. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GError, g_error_fre

[RFC PATCH] linux-user/syscall: Use g_file_open_tmp()

2020-02-27 Thread Philippe Mathieu-Daudé
Use GLib g_file_open_tmp() instead of getenv + snprintf + mkstemp. Signed-off-by: Philippe Mathieu-Daudé --- RFC because I'm not sure g_autoptr(GError) works this way. linux-user/syscall.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/linux-user/syscall.c b/lin