diff options
author | Vitaliy Cherepanov <v.cherepanov@samsung.com> | 2014-10-22 12:04:33 +0400 |
---|---|---|
committer | Vitaliy Cherepanov <v.cherepanov@samsung.com> | 2014-10-22 12:04:33 +0400 |
commit | 332cdddd5d904ceafa5248bfff6fc8854129c148 (patch) | |
tree | aadc9624dff2028eb39cd01ad275d790b5c5f3e2 | |
parent | 97edc06e50eab762d6abdc8665856a8611c9289c (diff) | |
download | swap-manager-332cdddd5d904ceafa5248bfff6fc8854129c148.tar.gz swap-manager-332cdddd5d904ceafa5248bfff6fc8854129c148.tar.bz2 swap-manager-332cdddd5d904ceafa5248bfff6fc8854129c148.zip |
[FIX] error codes ack
Change-Id: I414078a596445d4a362da3134615c40e7e9580b0
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
-rw-r--r-- | daemon/da_protocol.c | 3 | ||||
-rw-r--r-- | daemon/da_protocol.h | 26 |
2 files changed, 16 insertions, 13 deletions
diff --git a/daemon/da_protocol.c b/daemon/da_protocol.c index c4fa14b..14f5b86 100644 --- a/daemon/da_protocol.c +++ b/daemon/da_protocol.c @@ -931,6 +931,7 @@ static int process_msg_start(struct msg_buf_t *msg_control) if (check_running_status(&prof_session) == 1) { LOGW("Profiling has already been started\n"); + err_code = ERR_ALREADY_RUNNING; goto send_ack; } @@ -1276,6 +1277,8 @@ int host_message_handler(struct msg_t *msg) return process_msg_get_process_add_info(&msg_control); default: LOGE("unknown message %d <0x%08X>\n", msg->id, msg->id); + error_code = ERR_WRONG_MESSAGE_TYPE; + goto send_ack; } return 0; diff --git a/daemon/da_protocol.h b/daemon/da_protocol.h index 38368d3..abd6990 100644 --- a/daemon/da_protocol.h +++ b/daemon/da_protocol.h @@ -74,23 +74,23 @@ NMSG_CONTEXT_SWITCH_EXIT =0x0011, //N irregular swap instrumentation for kernel #define MSG_MAX_NUM NMSG_SWAP_INST_REMOVE enum ErrorCode{ - ERR_NO =0, //success - ERR_LOCKFILE_CREATE_FAILED =-101, //lock file create failed - ERR_ALREADY_RUNNING =-102, //already running - ERR_INITIALIZE_SYSTEM_INFO_FAILED =-103, //initialize system info failed + ERR_NO =0, //success + ERR_LOCKFILE_CREATE_FAILED =-101, //lock file create failed + ERR_ALREADY_RUNNING =-102, //already running + ERR_INITIALIZE_SYSTEM_INFO_FAILED =-103, //initialize system info failed ERR_HOST_SERVER_SOCKET_CREATE_FAILED =-104, //host server socket create failed ERR_TARGET_SERVER_SOCKET_CREATE_FAILED =-105, //target server socket create failed - ERR_SIGNAL_MASK_SETTING_FAILED =-106, //TODO del (old parametr) + ERR_SIGNAL_MASK_SETTING_FAILED =-106, //TODO del (old parametr) - ERR_WRONG_MESSAGE_FORMAT =-201, //wrong message format - ERR_WRONG_MESSAGE_TYPE =-202, //wrong message type - ERR_WRONG_MESSAGE_DATA =-203, //wrong message data - ERR_CANNOT_START_PROFILING =-204, //cannot start profiling - ERR_SERV_SOCK_CREATE =-900, //server socket creation failed (written in /tmp/da.port file) - ERR_SERV_SOCK_BIND =-901, //server socket bind failed (written in /tmp/da.port file) - ERR_SERV_SOCK_LISTEN =-902, //server socket listen failed (written in /tmp/da.port file) - ERR_UNKNOWN =-999 //unknown error + ERR_WRONG_MESSAGE_FORMAT =-201, //wrong message format + ERR_WRONG_MESSAGE_TYPE =-202, //wrong message type + ERR_WRONG_MESSAGE_DATA =-203, //wrong message data + ERR_CANNOT_START_PROFILING =-204, //cannot start profiling + ERR_SERV_SOCK_CREATE =-900, //server socket creation failed (written in /tmp/da.port file) + ERR_SERV_SOCK_BIND =-901, //server socket bind failed (written in /tmp/da.port file) + ERR_SERV_SOCK_LISTEN =-902, //server socket listen failed (written in /tmp/da.port file) + ERR_UNKNOWN =-999 //unknown error }; #define FL_SYSTEM_ENERGY_OLD (1<<26) |