Change in simtrace2[master]: [lib] apdu_dispatch: Use DLGLOBAL and don't printf() directly

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Dec 17 12:46:21 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/simtrace2/+/16630 )

Change subject: [lib] apdu_dispatch: Use DLGLOBAL and don't printf() directly
......................................................................

[lib] apdu_dispatch: Use DLGLOBAL and don't printf() directly

Change-Id: I2f3ec49d34b6806e13af185fb629cabc486891fb
---
M host/lib/apdu_dispatch.c
1 file changed, 7 insertions(+), 6 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/host/lib/apdu_dispatch.c b/host/lib/apdu_dispatch.c
index 62a75aa..835b8bc 100644
--- a/host/lib/apdu_dispatch.c
+++ b/host/lib/apdu_dispatch.c
@@ -1,6 +1,6 @@
 /* apdu_dispatch - State machine to determine Rx/Tx phases of APDU
  *
- * (C) 2016 by Harald Welte <hwelte at hmw-consulting.de>
+ * (C) 2016-2019 by Harald Welte <hwelte at hmw-consulting.de>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -24,6 +24,7 @@
 #include <errno.h>
 
 #include <osmocom/core/utils.h>
+#include <osmocom/core/logging.h>
 #include <osmocom/sim/sim.h>
 #include <osmocom/sim/class_tables.h>
 
@@ -105,7 +106,7 @@
 			break;
 		case 0:
 		default:
-			fprintf(stderr, "Unknown APDU case %d\n", ac->apdu_case);
+			LOGP(DLGLOBAL, LOGL_ERROR, "Unknown APDU case %d\n", ac->apdu_case);
 			return -1;
 		}
 	} else {
@@ -124,8 +125,8 @@
 			ac->lc.cur += cpy_len;
 			break;
 		default:
-			fprintf(stderr, "Unknown APDU case %d\n", ac->apdu_case);
-			break;
+			LOGP(DLGLOBAL, LOGL_ERROR, "Unknown APDU case %d\n", ac->apdu_case);
+			return -1;
 		}
 	}
 
@@ -163,8 +164,8 @@
 		break;
 	case 0:
 	default:
-		fprintf(stderr, "Unknown APDU case %d\n", ac->apdu_case);
-		break;
+		LOGP(DLGLOBAL, LOGL_ERROR, "Unknown APDU case %d\n", ac->apdu_case);
+		return -1;
 	}
 
 	dump_apdu_ctx(ac);

-- 
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/16630
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I2f3ec49d34b6806e13af185fb629cabc486891fb
Gerrit-Change-Number: 16630
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191217/ea197e3a/attachment.htm>


More information about the gerrit-log mailing list