From: shingil.kang Date: Mon, 22 Dec 2014 07:10:38 +0000 (+0900) Subject: SDB: Do not restart sdb server if the version of sdb client is not same with sdb... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F32748%2F1;p=sdk%2Ftools%2Fsdb.git SDB: Do not restart sdb server if the version of sdb client is not same with sdb server. If the version of sdb client is higher or lower than that of sdb server, prints warning message. Change-Id: I0ab09544fee1a1911031d44234666c769c5182be Signed-off-by: shingil.kang --- diff --git a/src/sdb_client.c b/src/sdb_client.c index 43d9ae0..0e4af62 100644 --- a/src/sdb_client.c +++ b/src/sdb_client.c @@ -414,15 +414,13 @@ int sdb_connect(const char *service) size_t cnt = tokenize(buf, ".", tokens, 3); if (cnt == 3) { // since tizen2.2.1 rc 15 - int major = strtoul(tokens[0], 0, 10); - int minor = strtoul(tokens[1], 0, 10); - int patch = strtoul(tokens[2], 0, 10); - if (major != SDB_VERSION_MAJOR || minor != SDB_VERSION_MINOR || patch != SDB_VERSION_PATCH ) { - fprintf(stdout, - "* sdb (%s) already running, and restarting sdb (%d.%d.%d) again *\n", - buf, SDB_VERSION_MAJOR, SDB_VERSION_MINOR, - SDB_VERSION_PATCH); - restarting = 1; + int server_major = strtoul(tokens[0], 0, 10); + int server_minor = strtoul(tokens[1], 0, 10); + int server_patch = strtoul(tokens[2], 0, 10); + + // If the version of client is not same with that of server + if ((server_major != SDB_VERSION_MAJOR) || (server_minor != SDB_VERSION_MINOR) || (server_patch != SDB_VERSION_PATCH)) { + fprintf(stdout, "* The version of SDB client (%d.%d.%d) is not same with that of SDB server (%d.%d.%d).\n It may cause version compatibility problems.\n It is recommended to use SDB server with version %d.%d.%d. *\n", SDB_VERSION_MAJOR, SDB_VERSION_MINOR, SDB_VERSION_PATCH, server_major, server_minor, server_patch, SDB_VERSION_MAJOR, SDB_VERSION_MINOR, SDB_VERSION_PATCH); } } else { int ver = 0;