Change in libosmocore[master]: osmo-sim-test: Use stderr for error messages

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
Sat Mar 21 16:15:51 UTC 2020


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

Change subject: osmo-sim-test: Use stderr for error messages
......................................................................

osmo-sim-test: Use stderr for error messages

Change-Id: I8f36b07b8601af2b0d54d95c3c6374d6c54bafd1
---
M utils/osmo-sim-test.c
1 file changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c
index 27de0bc..2bf83fa 100644
--- a/utils/osmo-sim-test.c
+++ b/utils/osmo-sim-test.c
@@ -326,25 +326,25 @@
 
 	msg = select_file(chan, fid);
 	if (!msg) {
-		printf("Unable to select file\n");
+		fprintf(stderr, "Unable to select file\n");
 		return -EIO;
 	}
 	printf("SW: %s\n", osim_print_sw(chan->card, msgb_apdu_sw(msg)));
 	if (msgb_apdu_sw(msg) != 0x9000) {
-		printf("status 0x%04x selecting file\n", msgb_apdu_sw(msg));
+		fprintf(stderr, "status 0x%04x selecting file\n", msgb_apdu_sw(msg));
 		goto out;
 	}
 
 	if (g_class != 0xA0) {
 		rc = tlv_parse(&tp, &ts102221_fcp_tlv_def, msgb_apdu_de(msg)+2, msgb_apdu_le(msg)-2, 0, 0);
 		if (rc < 0) {
-			printf("Unable to parse FCP: %s\n", msgb_hexdump(msg));
+			fprintf(stderr, "Unable to parse FCP: %s\n", msgb_hexdump(msg));
 			goto out;
 		}
 
 		if (!TLVP_PRESENT(&tp, UICC_FCP_T_FILE_DESC) ||
 		    TLVP_LEN(&tp, UICC_FCP_T_FILE_DESC) < 2) {
-			printf("No file descriptor present ?!?\n");
+			fprintf(stderr, "No file descriptor present ?!?\n");
 			goto out;
 		}
 
@@ -355,12 +355,12 @@
 	}
 
 	if (rc < 0) {
-		printf("Unable to decode File Descriptor\n");
+		fprintf(stderr, "Unable to decode File Descriptor\n");
 		goto out;
 	}
 
 	if (ffdd.type != TYPE_EF) {
-		printf("File Type != EF\n");
+		fprintf(stderr, "File Type != EF\n");
 		goto out;
 	}
 
@@ -384,7 +384,7 @@
 			i = ntohs(*(uint16_t *)TLVP_VAL(&tp, UICC_FCP_T_FILE_SIZE));
 			printf("File size: %d bytes\n", i);
 		} else {
-			printf("Can not determine file size, invalid EF-type!\n");
+			fprintf(stderr, "Can not determine file size, invalid EF-type!\n");
 			goto out;
 		}
 		for (offset = 0; offset < i-1; ) {

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8f36b07b8601af2b0d54d95c3c6374d6c54bafd1
Gerrit-Change-Number: 17551
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/20200321/72d1a19d/attachment.htm>


More information about the gerrit-log mailing list