From: Denis Kenzior Date: Thu, 9 Sep 2010 03:48:19 +0000 (-0500) Subject: simfs: Simplify logic X-Git-Tag: 0.28~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc1e3a7da4004c39b3f693e8eac74e9bc6dedefa;p=platform%2Fupstream%2Fofono.git simfs: Simplify logic --- diff --git a/src/simfs.c b/src/simfs.c index 7a9ecc5..2ac1a4f 100644 --- a/src/simfs.c +++ b/src/simfs.c @@ -491,18 +491,17 @@ static void sim_fs_op_info_cb(const struct ofono_error *error, int length, goto out; fs->fd = TFR(open(path, O_RDWR | O_CREAT | O_TRUNC, SIM_CACHE_MODE)); + g_free(path); if (fs->fd == -1) - goto out; + return; - if (TFR(write(fs->fd, fileinfo, SIM_CACHE_HEADER_SIZE)) != - SIM_CACHE_HEADER_SIZE) { - TFR(close(fs->fd)); - fs->fd = -1; - } + if (TFR(write(fs->fd, fileinfo, SIM_CACHE_HEADER_SIZE)) == + SIM_CACHE_HEADER_SIZE) + return; -out: - g_free(path); + TFR(close(fs->fd)); + fs->fd = -1; } static gboolean sim_fs_op_check_cached(struct sim_fs *fs)