From: Jiwoong Im Date: Thu, 24 Mar 2016 13:16:16 +0000 (+0900) Subject: common : fix ENOENT handling in direct_get X-Git-Tag: accepted/tizen/common/20160325.135450^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F68%2F63568%2F2;p=platform%2Fcore%2Fsystem%2Fbuxton2.git common : fix ENOENT handling in direct_get Change-Id: I86a06a79f92543a74564a940c1cce525531608c7 Signed-off-by: Jiwoong Im --- diff --git a/common/direct.c b/common/direct.c index cf582c4..d073589 100644 --- a/common/direct.c +++ b/common/direct.c @@ -157,16 +157,15 @@ int direct_get(const struct buxton_layer *layer, r = get_val(ly, layer->uid, BUXTON_LAYER_NORMAL, key, NULL, NULL, &db_val); - if (r == -1 && errno != ENOENT) { + if (r == -1) { + if (errno == ENOENT) { + *val = base_val; + return 0; + } value_free(&base_val); return -1; } - if (errno == ENOENT) { - *val = base_val; - return 0; - } - value_free(&base_val); *val = db_val;