Commit 99072120 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

Looks like resetting EOF was enough

parent 0e99d15e
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "camogm_read.h" #include "camogm_read.h"
#include "camogm.h" #include "camogm.h"
#ifdef USE_POLL #ifdef USE_POLL
#include <poll.h> #include <poll.h>
#endif #endif
...@@ -1346,6 +1347,11 @@ char * getLineFromPipe(FILE* npipe) ...@@ -1346,6 +1347,11 @@ char * getLineFromPipe(FILE* npipe)
fl = read(npipe, &cmdbuf[cmdbufp], sizeof(cmdbuf) - cmdbufp - 1); fl = read(npipe, &cmdbuf[cmdbufp], sizeof(cmdbuf) - cmdbufp - 1);
#else #else
fl = fread(&cmdbuf[cmdbufp], 1, sizeof(cmdbuf) - cmdbufp - 1, npipe); fl = fread(&cmdbuf[cmdbufp], 1, sizeof(cmdbuf) - cmdbufp - 1, npipe);
// reset EOF
if (feof(npipe)) {
clearerr(npipe);
}
#endif #endif
cmdbuf[cmdbufp + fl] = 0; cmdbuf[cmdbufp + fl] = 0;
// is there any complete string in a buffer after reading? // is there any complete string in a buffer after reading?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment