From: Vitaliy Cherepanov Date: Thu, 1 Oct 2015 12:27:18 +0000 (+0300) Subject: [FIX] prevent issue X-Git-Tag: submit/tizen/20151105.065919~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ad118ea0bc621cb660763dca574420025c9cc1c;p=platform%2Fcore%2Fsystem%2Fswap-manager.git [FIX] prevent issue ---------------------------------------------------------------------------------| | CID | Type | File | Function | |--------------------------------------------------------------------------------| | 482185 | dead code | daemon/wsi.c | all | |--------------------------------------------------------------------------------| Change-Id: I2a7d81ad1b859eefa7e8abbcf047372ead858b69 Signed-off-by: Vitaliy Cherepanov --- diff --git a/daemon/wsi.c b/daemon/wsi.c index ec8da8c..13337ec 100644 --- a/daemon/wsi.c +++ b/daemon/wsi.c @@ -48,15 +48,15 @@ #define MAX_MSG_LENGTH 4096 -#define PSTATE_DEFAULT (0) -#define PSTATE_CONNECTED (1L << ( 0)) -#define PSTATE_PROFILING (1L << ( 1)) -#define PSTATE_WAIT_ACK (1L << ( 2)) -#define PSTATE_TIMEOUT (1L << ( 3)) -#define PSTATE_START (1L << ( 4)) -#define PSTATE_DISCONNECT (1L << ( 5)) -#define PSTATE_INIT_START (1L << ( 6)) -#define PSTATE_INIT_DONE (1L << ( 7)) +#define PSTATE_DEFAULT (1L << ( 0)) +#define PSTATE_CONNECTED (1L << ( 1)) +#define PSTATE_PROFILING (1L << ( 2)) +#define PSTATE_WAIT_ACK (1L << ( 3)) +#define PSTATE_TIMEOUT (1L << ( 4)) +#define PSTATE_START (1L << ( 5)) +#define PSTATE_DISCONNECT (1L << ( 6)) +#define PSTATE_INIT_START (1L << ( 7)) +#define PSTATE_INIT_DONE (1L << ( 8)) #define SETSTAT(S, F) ((S) |= (F)) #define CLRSTAT(S, F) ((S) &= ~(F)) @@ -273,6 +273,7 @@ static int profiling_callback(struct libwebsocket_context *context, case LWS_CALLBACK_DEL_POLL_FD: LOGE("LWS_CALLBACK_DEL_POLL_FD\n"); + /* Call through. Connection closed. */ case LWS_CALLBACK_CLOSED: LOGI("Connection closed\n"); CLRSTAT(pstate, PSTATE_CONNECTED); @@ -498,6 +499,7 @@ static void *do_start(void *arg) goto out; } + CLRSTAT(pstate, PSTATE_DEFAULT); SETSTAT(pstate, PSTATE_INIT_DONE); out: @@ -526,7 +528,7 @@ void wsi_stop(void) if (CHKSTAT(pstate, PSTATE_INIT_START)) { /* init was start */ - while (!CHKSTAT(pstate, PSTATE_INIT_DONE) && !CHKSTAT(pstate, PSTATE_DEFAULT)) { + while (!CHKSTAT(pstate, PSTATE_INIT_DONE | PSTATE_DEFAULT)) { LOGW("stop request while init not finished. wait.\n"); sleep(1); }