Don't printf NULL pointers on HAL connection error
Fixes Solaris bug 6801386 Xorg core dumps on startup if hald not running http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6801386 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
This commit is contained in:
parent
b680bda34d
commit
1e816065e5
|
@ -493,12 +493,14 @@ connect_and_register(DBusConnection *connection, struct config_hal_info *info)
|
||||||
}
|
}
|
||||||
if (!libhal_ctx_init(info->hal_ctx, &error)) {
|
if (!libhal_ctx_init(info->hal_ctx, &error)) {
|
||||||
LogMessage(X_ERROR, "config/hal: couldn't initialise context: %s (%s)\n",
|
LogMessage(X_ERROR, "config/hal: couldn't initialise context: %s (%s)\n",
|
||||||
error.name, error.message);
|
error.name ? error.name : "unknown error",
|
||||||
|
error.message ? error.message : "null");
|
||||||
goto out_ctx;
|
goto out_ctx;
|
||||||
}
|
}
|
||||||
if (!libhal_device_property_watch_all(info->hal_ctx, &error)) {
|
if (!libhal_device_property_watch_all(info->hal_ctx, &error)) {
|
||||||
LogMessage(X_ERROR, "config/hal: couldn't watch all properties: %s (%s)\n",
|
LogMessage(X_ERROR, "config/hal: couldn't watch all properties: %s (%s)\n",
|
||||||
error.name, error.message);
|
error.name ? error.name : "unknown error",
|
||||||
|
error.message ? error.message : "null");
|
||||||
goto out_ctx2;
|
goto out_ctx2;
|
||||||
}
|
}
|
||||||
libhal_ctx_set_device_added(info->hal_ctx, device_added);
|
libhal_ctx_set_device_added(info->hal_ctx, device_added);
|
||||||
|
@ -518,7 +520,8 @@ connect_and_register(DBusConnection *connection, struct config_hal_info *info)
|
||||||
out_ctx2:
|
out_ctx2:
|
||||||
if (!libhal_ctx_shutdown(info->hal_ctx, &error))
|
if (!libhal_ctx_shutdown(info->hal_ctx, &error))
|
||||||
LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n",
|
LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n",
|
||||||
error.name, error.message);
|
error.name ? error.name : "unknown error",
|
||||||
|
error.message ? error.message : "null");
|
||||||
out_ctx:
|
out_ctx:
|
||||||
libhal_ctx_free(info->hal_ctx);
|
libhal_ctx_free(info->hal_ctx);
|
||||||
out_err:
|
out_err:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user