callouts: always print the environment even if no scripts are present

Commit ac6522bbf1 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.
This commit is contained in:
Thomas Haller 2016-01-19 11:01:33 +01:00
parent f7c76b372c
commit a841d40039

View file

@ -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++;