return;
}
+static inline const char *__get_client_type(vcd_client_type_e type)
+{
+ switch (type) {
+ case VCD_CLIENT_TYPE_NORMAL:
+ return "Normal";
+ case VCD_CLIENT_TYPE_WIDGET:
+ return "Widget";
+ case VCD_CLIENT_TYPE_MANAGER:
+ return "Manager";
+ default:
+ return "Invalid";
+ }
+}
+
static void __vcd_cleanup_client(vcd_client_type_e type)
{
int* client_list = NULL;
}
if (0 == ret || mgr_pid > 0) {
- SLOG(LOG_INFO, TAG_VCD, "@@@ Clean up %s client ", type ? (type == VCD_CLIENT_TYPE_WIDGET) ? "Widget" : "Manager" : "Normal");
+ SLOG(LOG_INFO, TAG_VCD, "@@@ Clean up %s client ", __get_client_type(type));
if (NULL != client_list && client_count > 0) {
for (i = 0; i < client_count; i++) {
exist = false;
iter = g_list_nth(g_proc_list, j);
if (NULL != iter) {
if (*(client_list + i) == GPOINTER_TO_INT(iter->data)) {
- SLOG(LOG_INFO, TAG_VCD, "%s pid(%d) is running", type ? (type == VCD_CLIENT_TYPE_WIDGET) ? "Widget" : "Manager" : "Normal", *(client_list + i));
+ SLOG(LOG_INFO, TAG_VCD, "%s pid(%d) is running", __get_client_type(type), *(client_list + i));
exist = true;
break;
}
}
if (false == exist) {
- SLOG(LOG_ERROR, TAG_VCD, "%s pid(%d) should be removed", type ? (type == VCD_CLIENT_TYPE_WIDGET) ? "Widget" : "Manager" : "Normal", *(client_list + i));
+ SLOG(LOG_ERROR, TAG_VCD, "%s pid(%d) should be removed", __get_client_type(type), *(client_list + i));
if (VCD_CLIENT_TYPE_NORMAL == type)
vcd_server_finalize(*(client_list + i));
else if (VCD_CLIENT_TYPE_WIDGET == type)