*pname ? pname : "Unknown", pid, states[state].name, KILLABLE_DAEMON_LOCK_LIMIT);
ret = kill(pid, SIGTERM);
if (ret < 0)
- CRITICAL_LOG("Failed to send SIGTERM to process %s(%d), %d.",
+ CRITICAL_LOG_E("Failed to send SIGTERM to process %s(%d), %d.",
*pname ? pname : "Unknown", pid, errno);
node->force_release = true;
ret = kill(pid, SIGKILL);
if (ret < 0)
- CRITICAL_LOG("Failed to kill process %s(%d), %d.",
+ CRITICAL_LOG_E("Failed to kill process %s(%d), %d.",
*pname ? pname : "Unknown", pid, errno);
}
: gdbus_call_sync_with_reply_int(DEVICED_BUS_NAME, DEVICED_PATH_POWEROFF, DEVICED_INTERFACE_POWEROFF, "PowerOff", g_variant_new("(s)", action), NULL)
;
if (ret_dbus < 0) {
- CRITICAL_LOG("Error while calling deviced: %d", ret_dbus);
+ CRITICAL_LOG_E("Error while calling deviced: %d", ret_dbus);
return false;
} else
CRITICAL_LOG("Succesfully requested shutdown using deviced");
break;
}
- CRITICAL_LOG("Failed to shutdown system using deviced - falling back to systemd shutdown");
+ CRITICAL_LOG_E("Failed to shutdown system using deviced - falling back to systemd shutdown");
return false;
}
if (!delayed_init_done && !is_poweroff_state(ti->next)) {
struct trans_info *deferred_ti = calloc(1, sizeof(struct trans_info));
if (!deferred_ti) {
- CRITICAL_LOG("Failed to defer transition.");
+ CRITICAL_LOG_E("Failed to defer transition.");
return 0;
}
#ifdef CRITICAL_LOG_ON
#define CRITICAL_LOG(fmt, arg...) \
do { CRITICAL_LOG_(LOG_ID_SYSTEM, DLOG_INFO, LOG_TAG, fmt, ##arg); } while (0)
+#define CRITICAL_LOG_E(fmt, arg...) \
+ do { CRITICAL_LOG_(LOG_ID_SYSTEM, DLOG_ERROR, LOG_TAG, fmt, ##arg); } while (0)
#else
-#define CRITICAL_LOG(fmt, arg...) _I(fmt, ##arg)
+#define CRITICAL_LOG(fmt, arg...) _I(fmt, ##arg)
+#define CRITICAL_LOG_E(fmt, arg...) _E(fmt, ##arg)
#endif
#define _D(fmt, arg...) \
&__usb_gadget_disable,
&__usb_gadget_reconfigure);
} else {
- CRITICAL_LOG("Usb-gadget is not supported.");
+ CRITICAL_LOG_E("Usb-gadget is not supported.");
return -ENOTSUP;
}
if (__usb_gadget_open) {
ret = __usb_gadget_open();
if (ret != 0) {
- CRITICAL_LOG("Failed to open usb-gadget, %d", ret);
+ CRITICAL_LOG_E("Failed to open usb-gadget, %d", ret);
return ret;
}
}
ret = usb_gadget_ops_init();
if (ret < 0) {
- CRITICAL_LOG("USB client cannot be used: %d", ret);
+ CRITICAL_LOG_E("USB client cannot be used: %d", ret);
return;
}