]> git.webhop.me Git - lcd4linux.git/commitdiff
minor update
authormichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Mon, 14 Apr 2008 10:47:21 +0000 (10:47 +0000)
committermichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Mon, 14 Apr 2008 10:47:21 +0000 (10:47 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@875 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

plugin_fifo.c

index fc3f77f430ba1314513fc60291a5a7f3e4671496..59422e5fde49b23d78e73c6a61c7dc3be4be3710 100644 (file)
@@ -68,12 +68,15 @@ static char fifopath[1024];
 static void configure_fifo(void)
 {
     char *s;
+    memset(fifopath, 0, 1024);
     s = cfg_get(Section, "fifopath", "/tmp/lcd4linux.fifo");
     if (*s == '\0') {
        info("[FIFO] empty '%s.fifopath' entry from %s, assuming '/tmp/lcd4linux.fifo'", Section, cfg_source());
        strcpy(fifopath, "/tmp/lcd4linux.fifo");
-    } else
+    } else {
        strcpy(fifopath, s);
+       info("[FIFO] read '%s.fifopath', value is '%s'", Section, fifopath);
+    }
     free(s);
 }
 
@@ -153,10 +156,12 @@ static void fiforead(RESULT * result)
     strcat(buf, "ERROR");
     if (checkFifo() == 0) {
        memset(buf, 0, FIFO_BUFFER_SIZE);
-       while (bytes > 0 && errno != EINTR)
+       while (bytes > 0 && errno != EINTR) {
            bytes = read(fd.input, buf, FIFO_BUFFER_SIZE);
+       }
+       
        if (bytes < 0) {
-           error("[FIFO] Error %i: %s\n", errno, strerror(errno));
+           error("[FIFO] Error %i: %s", errno, strerror(errno));
        } else {
            if (strlen(buf) > 0) {
                strcpy(msg, buf);
@@ -166,7 +171,7 @@ static void fiforead(RESULT * result)
                    msg[i] = ' ';
            }
        }
-    }
+    } 
 
     /* store result */
     SetResult(&result, R_STRING, msg);