ret = -1;
goto cleanup;
}
- DebugOutput::set_output (argv [i]);
+ DebugOutput::set_output (String (argv [i]));
continue;
}
LOGD("no focus");
SECURE_LOGD ("%s key is pressed. ret : %d", ev->keyname, filter_ret);
- if (filter_ret) {
- return EINA_FALSE; /* the event is removed from the queue */
- }
return EINA_FALSE; /* the event is removed from the queue */
}
return EINA_TRUE; /* the event is kept */
if (trans.write_to_socket(client_socket)
&& trans.read_from_socket(client_socket)
- && trans.get_command(cmd) && cmd == SCIM_TRANS_CMD_REPLY) {
- trans.get_data(imdata, len);
+ && trans.get_command(cmd) && cmd == SCIM_TRANS_CMD_REPLY
+ && trans.get_data(imdata, len)) {
LOGD ("length of imdata is %d", len);
} else {
LOGW ("read imdata failed");
if (m_info_manager->check_privilege_by_sockfd(client_id, IMEMANAGER_PRIVILEGE)) {
String strAppid;
uint32 nEnabled = 0;
- bool ret = true;
- //FIXME
- //ret need be checked
+
m_info_manager->is_helper_ise_enabled(client_id, strAppid, nEnabled);
Transaction trans;
Socket client_socket(client_id);
trans.clear();
trans.put_command(SCIM_TRANS_CMD_REPLY);
-
- if (ret) {
- trans.put_command(SCIM_TRANS_CMD_OK);
- trans.put_data(static_cast<uint32>(nEnabled));
- } else {
- trans.put_command(SCIM_TRANS_CMD_FAIL);
- }
-
+ trans.put_command(SCIM_TRANS_CMD_OK);
+ trans.put_data(static_cast<uint32>(nEnabled));
trans.write_to_socket(client_socket);
}
else {
if (context_scim->selection_text_fd_read_handler) {
int fd = ecore_main_fd_handler_fd_get (context_scim->selection_text_fd_read_handler);
- close (fd);
+ if (fd >= 0)
+ close (fd);
ecore_main_fd_handler_del (context_scim->selection_text_fd_read_handler);
context_scim->selection_text_fd_read_handler = NULL;
}
if (context_scim->surrounding_text_fd_read_handler) {
int fd = ecore_main_fd_handler_fd_get (context_scim->surrounding_text_fd_read_handler);
- close (fd);
+ if (fd >= 0)
+ close (fd);
ecore_main_fd_handler_del (context_scim->surrounding_text_fd_read_handler);
context_scim->surrounding_text_fd_read_handler = NULL;
}
if (context_scim->remote_surrounding_text_fd_read_handler) {
int fd = ecore_main_fd_handler_fd_get (context_scim->remote_surrounding_text_fd_read_handler);
- close (fd);
+ if (fd >= 0)
+ close (fd);
ecore_main_fd_handler_del (context_scim->remote_surrounding_text_fd_read_handler);
context_scim->remote_surrounding_text_fd_read_handler = NULL;
}
// we need set the focused_ic to this context temporary.
WSCContextISF* old_focused = _focused_ic;
_focused_ic = context_scim;
- _focused_ic = old_focused;
+ context_scim = old_focused;
if (context_scim == _focused_ic) {
g_info_manager->socket_turn_off ();
WSCContextISF* wsc_ctx = (WSCContextISF*)data;
int fd = ecore_main_fd_handler_fd_get (fd_handler);
+ if (fd < 0)
+ return ECORE_CALLBACK_RENEW;
+
char buff[512];
int len = read (fd, buff, sizeof (buff) - 1);
if (ic->surrounding_text_fd_read_handler) {
int fd = ecore_main_fd_handler_fd_get (ic->surrounding_text_fd_read_handler);
- close (fd);
+ if (fd >= 0)
+ close (fd);
ecore_main_fd_handler_del (ic->surrounding_text_fd_read_handler);
ic->surrounding_text_fd_read_handler = NULL;
}
return false;
}
- if (appid.size () > 0) {
- m_trans.get_data (label);
- m_trans.get_data (is_enabled);
- m_trans.get_data (is_preinstalled);
- m_trans.get_data (has_option);
+ if (appid.size () > 0 && m_trans.get_data (label) && m_trans.get_data (is_enabled) && m_trans.get_data (is_preinstalled) && m_trans.get_data (has_option)) {
if (appid.size () == label.size () && appid.size () == is_enabled.size () && appid.size () == is_preinstalled.size () && appid.size () == has_option.size ()) {
info.appid = appid;
info.label = label;
_db_disconnect();
LOGD("need_reset, removing db");
databaseInfo.need_reset = false;
- remove(databaseInfo.pPath);
+ if (remove(databaseInfo.pPath) != 0)
+ LOGW ("Error deleting path");
ret = _db_init();
}
}
}
- String exec = String (argv[0]);
+ String exec = argv[0];
if (exec != String (SCIM_HELPER_LAUNCHER_PROGRAM)) {
/* 3rd party shared object type IME */
char buf [2048] = {0,};
setpwent ();
- getpwuid_r (getuid (), &pw, buf, sizeof (buf), &result);
+ int ret = getpwuid_r (getuid (), &pw, buf, sizeof (buf), &result);
endpwent ();
+ if (ret != 0 || !result) {
+ LOGE ("Fail to getpwuid_r");
+ return String ("");
+ }
+
if (result && pw.pw_name) {
return String (pw.pw_name);
} else if ((user_name = getenv ("USER")) != NULL) {