diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-10-02 14:02:28 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-10-02 18:25:56 -0500 |
commit | be55ba4ab3e706caa9cbc6c854e78d045c723f9a (patch) | |
tree | add0164280a4cb8fa7baecdf148843b3ccea2e41 /src/voicecall.c | |
parent | 6d9ec892595344d830e6831e3a868a67f4dfcf9c (diff) | |
download | ofono-be55ba4ab3e706caa9cbc6c854e78d045c723f9a.tar.bz2 |
Refactor: Move elementary file type checking
Every single EF read callback checks the file type reported out of the
SIM is what it expects. Instead this should be done in one place and
the errors reported accordingly
Diffstat (limited to 'src/voicecall.c')
-rw-r--r-- | src/voicecall.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/voicecall.c b/src/voicecall.c index bc6986c5..eff6321b 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -1705,8 +1705,7 @@ static void set_new_ecc(struct ofono_voicecall *vc) emit_en_list_changed(vc); } -static void ecc_read_cb(int ok, enum ofono_sim_file_structure structure, - int total_length, int record, const unsigned char *data, +static void ecc_read_cb(int ok, int total_length, int record, const unsigned char *data, int record_length, void *userdata) { struct ofono_voicecall *vc = userdata; @@ -1718,8 +1717,7 @@ static void ecc_read_cb(int ok, enum ofono_sim_file_structure structure, if (!ok) goto check; - if (structure != OFONO_SIM_FILE_STRUCTURE_FIXED || - record_length < 4 || total_length < record_length) { + if (record_length < 4 || total_length < record_length) { ofono_error("Unable to read emergency numbers from SIM"); return; } @@ -1863,7 +1861,8 @@ static void sim_watch(struct ofono_atom *atom, return; } - ofono_sim_read(sim, SIM_EFECC_FILEID, ecc_read_cb, vc); + ofono_sim_read(sim, SIM_EFECC_FILEID, OFONO_SIM_FILE_STRUCTURE_FIXED, + ecc_read_cb, vc); } void ofono_voicecall_register(struct ofono_voicecall *vc) |