diff --git a/src/core/restart.c b/src/core/restart.c index e9a5bfd27..8e87efc1e 100644 --- a/src/core/restart.c +++ b/src/core/restart.c @@ -101,6 +101,15 @@ restart_message_painted (gpointer data) return FALSE; } +static void +child_setup (gpointer user_data) +{ + MetaDisplay *display = user_data; + MetaContext *context = meta_display_get_context (display); + + meta_context_restore_rlimit_nofile (context, NULL); +} + /** * meta_restart: * @message: (allow-none): message to display to the user, or %NULL @@ -148,7 +157,7 @@ meta_restart (const char *message) (char **)helper_argv, NULL, /* envp */ G_SPAWN_DEFAULT, - NULL, NULL, /* child_setup */ + child_setup, display, NULL, /* child_pid */ NULL, /* standard_input */ &helper_out_fd, diff --git a/src/core/util.c b/src/core/util.c index bfac2c071..1f1048ca3 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -26,6 +26,7 @@ #include "config.h" +#include "core/display-private.h" #include "core/util-private.h" #include @@ -518,6 +519,15 @@ append_argument (GPtrArray *args, g_ptr_array_add (args, locale_arg); } +static void +child_setup (gpointer user_data) +{ + MetaDisplay *display = meta_get_display (); + MetaContext *context = meta_display_get_context (display); + + meta_context_restore_rlimit_nofile (context, NULL); +} + /** * meta_show_dialog: (skip) * @type: type of dialog @@ -622,7 +632,7 @@ meta_show_dialog (const char *type, (gchar**) args->pdata, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, - NULL, NULL, + child_setup, NULL, &child_pid, &error );