From 7a697309e244bdb773eb706a867dc08bf7609f40 Mon Sep 17 00:00:00 2001 From: akuker Date: Thu, 9 Jul 2020 20:20:18 -0500 Subject: [PATCH] Fix issue #8 - Code would return error when file was CORRECTLY opened and report success when it failed. --- src/raspberrypi/rascsi.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index 5f64feb6..cf2f68f3 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -154,7 +154,7 @@ BOOL Init() // GPIOBUS creation bus = new GPIOBUS(); - + // GPIO Initialization if (!bus->Init()) { return FALSE; @@ -207,7 +207,7 @@ void Cleanup() // Cleanup the Bus bus->Cleanup(); - + // Discard the GPIOBUS object delete bus; @@ -307,7 +307,7 @@ void ListDevice(FILE *fp) FPRT(fp, "No device is installed.\n"); return; } - + FPRT(fp, "+----+----+------+-------------------------------------\n"); } @@ -581,7 +581,7 @@ BOOL ProcessCmd(FILE *fp, int id, int un, int cmd, int type, char *file) filepath.SetPath(file); // Open the file - if (pUnit->Open(filepath)) { + if (!pUnit->Open(filepath)) { FPRT(fp, "Error : File open error [%s]\n", file); return FALSE; } @@ -863,7 +863,7 @@ static void *MonThread(void *param) { struct sched_param schedparam; struct sockaddr_in client; - socklen_t len; + socklen_t len; int fd; FILE *fp; char buf[BUFSIZ]; @@ -893,8 +893,8 @@ static void *MonThread(void *param) while (1) { // Wait for connection - memset(&client, 0, sizeof(client)); - len = sizeof(client); + memset(&client, 0, sizeof(client)); + len = sizeof(client); fd = accept(monsocket, (struct sockaddr*)&client, &len); if (fd < 0) { break;