diff mbox

[1/3] spp-client: Warn user if xml file cannot be found.

Message ID 1432673254-1209-1-git-send-email-greearb@candelatech.com
State Accepted
Headers show

Commit Message

Ben Greear May 26, 2015, 8:47 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

Otherwise, all you get is a cryptic xml validation error out
of the spp-server.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 hs20/client/spp_client.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Jouni Malinen May 27, 2015, 9:32 a.m. UTC | #1
Thanks, all three patches applied.
diff mbox

Patch

diff --git a/hs20/client/spp_client.c b/hs20/client/spp_client.c
index cc1a0bf..4b16381 100644
--- a/hs20/client/spp_client.c
+++ b/hs20/client/spp_client.c
@@ -79,9 +79,13 @@  static void add_mo_container(struct xml_node_ctx *ctx, xml_namespace_t *ns,
 	xml_node_t *fnode, *tnds;
 	char *str;
 
+	errno = 0;
 	fnode = node_from_file(ctx, fname);
-	if (!fnode)
+	if (!fnode) {
+		wpa_printf(MSG_ERROR, "Failed to create xml node from file: %s, possible error: %s\n",
+			   fname, strerror(errno));
 		return;
+	}
 	tnds = mo_to_tnds(ctx, fnode, 0, urn, "syncml:dmddf1.2");
 	xml_node_free(ctx, fnode);
 	if (!tnds)