summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-09-08 22:48:19 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-09-09 08:50:28 -0500
commitfc1e3a7da4004c39b3f693e8eac74e9bc6dedefa (patch)
tree5acd9cc1bcf9127ac7d6dbe07b91f8c5fb463f8d /src
parent5754eaf7e98d10e9927a121e6325cfb73a8e8656 (diff)
downloadofono-fc1e3a7da4004c39b3f693e8eac74e9bc6dedefa.tar.bz2
simfs: Simplify logic
Diffstat (limited to 'src')
-rw-r--r--src/simfs.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/simfs.c b/src/simfs.c
index 7a9ecc53..2ac1a4f2 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)