From a841d40039186d6ea454610a314243deb4491ed7 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 19 Jan 2016 11:01:33 +0100 Subject: [PATCH] callouts: always print the environment even if no scripts are present Commit ac6522bbf109ac0af8845cc81903155bab914760 moved logging of the environment after the check for @error_message to avoid a crash. However, in case of no scripts (request->scripts->len == 0) we still want to log the environment, so move it back to where it was, but avoid the crash. --- callouts/nm-dispatcher.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/callouts/nm-dispatcher.c b/callouts/nm-dispatcher.c index eedc20dc67..a635e21685 100644 --- a/callouts/nm-dispatcher.c +++ b/callouts/nm-dispatcher.c @@ -718,6 +718,11 @@ handle_action (NMDBusDispatcher *dbus_dispatcher, g_slist_free (sorted_scripts); _LOG_R_I (request, "new request (%u scripts)", request->scripts->len); + if ( _LOG_R_D_enabled (request) + && request->envp) { + for (p = request->envp; *p; p++) + _LOG_R_D (request, "environment: %s", *p); + } if (error_message || request->scripts->len == 0) { GVariant *results; @@ -734,11 +739,6 @@ handle_action (NMDBusDispatcher *dbus_dispatcher, return TRUE; } - if (_LOG_R_D_enabled (request)) { - for (p = request->envp; *p; p++) - _LOG_R_D (request, "environment: %s", *p); - } - nm_clear_g_source (&quit_id); h->num_requests_pending++;