aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libkeccak/files.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libkeccak/files.c b/src/libkeccak/files.c
index e415126..95e9889 100644
--- a/src/libkeccak/files.c
+++ b/src/libkeccak/files.c
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <sys/stat.h>
#include <alloca.h>
+#include <errno.h>
/**
@@ -58,8 +59,14 @@ int libkeccak_generalised_sum_fd(int fd, libkeccak_state_t* restrict state,
for (;;)
{
got = read(fd, chunk, blksize);
- if (got < 0) return -1;
- if (got == 0) break;
+ if (got < 0)
+ {
+ if (errno == EINTR)
+ continue;
+ return -1;
+ }
+ if (got == 0)
+ break;
if (libkeccak_fast_update(state, chunk, (size_t)got) < 0)
return -1;
}