We need to call clearerr() when getc() returns EOF with errno == EINTR.
authorWayne Davison <wayned@samba.org>
Fri, 6 Jan 2006 22:20:07 +0000 (22:20 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 6 Jan 2006 22:20:07 +0000 (22:20 +0000)
exclude.c

index 35a64b9..8d74864 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -1006,8 +1006,10 @@ void parse_filter_file(struct filter_list_struct *listp, const char *fname,
                int ch, overflow = 0;
                while (1) {
                        if ((ch = getc(fp)) == EOF) {
-                               if (ferror(fp) && errno == EINTR)
+                               if (ferror(fp) && errno == EINTR) {
+                                       clearerr(fp);
                                        continue;
+                               }
                                break;
                        }
                        if (word_split && isspace(ch))