Read errors resulting from interrupted system calls are not fatal.

This commit is contained in:
W. Eric Norum
2004-03-24 01:45:23 +00:00
parent 7c34b847e0
commit a170d40be2

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#define epicsExportSharedSymbols
@@ -326,6 +327,12 @@ epicsReadline (const char *prompt, void *context)
}
while ((c = getc (in)) != '\n') {
if (c == EOF) {
if (ferror(in)) {
if ((errno == EINTR) || (errno == EPIPE)) {
clearerr(in);
continue;
}
}
free (line);
return NULL;
}