summaryrefslogtreecommitdiffstats
path: root/src/sim.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-07-10 18:54:05 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-07-14 15:45:04 -0500
commit5207f4063e75db024b48f6a42a5964b1b334a168 (patch)
tree118aa0ab948f05ca5687abd5673eab1961c034c7 /src/sim.c
parent285712e5d475523a389098d6f563806bad1e92b1 (diff)
downloadofono-5207f4063e75db024b48f6a42a5964b1b334a168.tar.bz2
If reading one fails, don't bother reading rest
Diffstat (limited to 'src/sim.c')
-rw-r--r--src/sim.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/sim.c b/src/sim.c
index 2d3097f7..2403cf9b 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -821,9 +821,15 @@ static void sim_op_retrieve_cb(const struct ofono_error *error,
struct sim_file_op *op = g_queue_peek_head(sim->simop_q);
int total = op->length / op->record_length;
- if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
- op->cb(modem, 1, op->structure, op->length, op->current,
- data, op->record_length, op->userdata);
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+ if (op->current == 1)
+ sim_op_error(modem);
+
+ return;
+ }
+
+ op->cb(modem, 1, op->structure, op->length, op->current,
+ data, op->record_length, op->userdata);
if (op->current == total) {
op = g_queue_pop_head(sim->simop_q);