From: Jiwoong Im Date: Wed, 24 Aug 2016 02:07:12 +0000 (+0900) Subject: remove unnecessary error check X-Git-Tag: accepted/tizen/common/20160824.154832~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d086e223b033fc0088a68faa4eb75737d92f169;p=platform%2Fcore%2Fsystem%2Fbuxton2.git remove unnecessary error check - check only the existence of the key before create key Change-Id: Ieff93c62f36f0e13fa65e02c84edd9b0f9ede9ac Signed-off-by: Jiwoong Im --- diff --git a/backend/gdbm.c b/backend/gdbm.c index ef00447..d62be1a 100644 --- a/backend/gdbm.c +++ b/backend/gdbm.c @@ -117,7 +117,7 @@ static int close_db(const char *dbpath) db = g_hash_table_lookup(dbs, dbpath); - if(!db) + if (!db) return 0; g_hash_table_remove(dbs, dbpath); diff --git a/common/direct.c b/common/direct.c index 1ee8cce..7004432 100644 --- a/common/direct.c +++ b/common/direct.c @@ -335,9 +335,6 @@ int direct_create(const struct buxton_layer *layer, const char *key, return -1; r = get_val(ly, layer->uid, BUXTON_LAYER_BASE, key, NULL, NULL, NULL); - if (r == -1 && errno != ENOENT) - return -1; - if (r == 0) { errno = EEXIST; return -1; @@ -345,7 +342,7 @@ int direct_create(const struct buxton_layer *layer, const char *key, r = direct_close(layer, ly); - if (r == -1){ + if (r == -1) { bxt_err("failed to close db(%s)", ly->name); return -1; }