From c9326e5fd46bb1ba986f0bcecebea6c044616656 Mon Sep 17 00:00:00 2001 From: Wolfgang Wiedmeyer Date: Thu, 20 Jul 2017 09:06:04 +0200 Subject: sahara: check if hello data was received and don't print alt file name The other memory table entry, that should provide a file name, was always empty during testing. Signed-off-by: Wolfgang Wiedmeyer --- sahara.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sahara.c b/sahara.c index 6d93ad1..939b58c 100644 --- a/sahara.c +++ b/sahara.c @@ -63,7 +63,11 @@ int hello_response(int tty_fd, int mode) struct sah_hello_resp hello_resp; int rc; - read_hello_data(tty_fd, mode, &hello_req); + rc = read_hello_data(tty_fd, mode, &hello_req); + if (rc < 0) { + printf("error receiving hello data\n"); + return -1; + } hello_resp.header.command = SAH_COMMAND_HELLO_RESP; hello_resp.header.packet_size = sizeof(hello_resp); @@ -350,9 +354,9 @@ int efs_sync(int tty_fd) return -1; } - printf("requested file %s (alt file name '%s') with address %d and size %d\n", - memory_table.file, memory_table.empty, - memory_table.address, memory_table.size); + printf("requested file %s with address %d and size %d\n", + memory_table.file, memory_table.address, + memory_table.size); rc = check_efs_file_request(memory_table.file); if (rc < 0) { -- cgit v1.2.3