Skip to contentSkip to conversation

Correct a copy+paste error in SIM write callback.

PATCH New Andrzej Zaborowski 2 participants 3 messages Aug 3, 2009 – Aug 4, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Correct a copy+paste error in SIM write callback.

---
 src/sim.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/sim.c +1 -1
index d432e1b..d4c7dbf 100644
@@ -479,7 +479,7 @@ static void sim_op_write_cb(const struct ofono_error *error, void *data)
 {
 	struct ofono_modem *modem = data;
 	struct sim_manager_data *sim = modem->sim_manager;
-	struct sim_file_op *op = g_queue_pop_head(sim->simop_q);
+	struct sim_file_op *op = g_queue_peek_head(sim->simop_q);
 	ofono_sim_file_write_cb_t cb = op->cb;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
Signature · 1 line
1.6.1
#1 lore raw

PATCH 1/1 Fix a copy+paste error in SIM write callback.

[Please ignore the first patch, I was fixing the wrong thing]

---
 src/sim.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
src/sim.c +4 -6
index 36ed90b..fb3af83 100644
@@ -503,12 +503,10 @@ static void sim_op_write_cb(const struct ofono_error *error, void *data)
 	struct sim_file_op *op = g_queue_pop_head(sim->simop_q);
 	ofono_sim_file_write_cb_t cb = op->cb;
 
-	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		sim_op_error(modem);
-		return;
-	}
-
-	cb(modem, 1, op->userdata);
+	if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
+		cb(modem, 1, op->userdata);
+	else
+		cb(modem, 0, op->userdata);
 
 	sim_file_op_free(op);
 
Signature · 1 line
1.6.1
#2 lore raw

Re: [PATCH] Fix a copy+paste error in SIM write callback.

Applied and pushed. Thanks.

Regards,
-Denis