apps/examples/fstest:  Fix coding error in last commit.
/****************************************************************************
* examples/fstest/fstest_main.c
*
- * Copyright (C) 2015 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2015, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -446,6 +446,10 @@ static inline int fstest_wrfile(FAR struct fstest_filedesc_s *file)
printf(" Write size: %ld\n", (long)nbytestowrite);
ret = ERROR;
}
+ else if (errcode == EINTR)
+ {
+ continue;
+ }
else
{
int ret2;
@@ -546,8 +550,18 @@ static ssize_t fstest_rdblock(int fd, FAR struct fstest_filedesc_s *file,
len = maxio;
}
+ for (; ; )
+ {
nbytesread = read(fd, &g_fileimage[offset], len);
if (nbytesread < 0)
+ {
+ int errcode = errno;
+
+ if (errcode == EINTR)
+ {
+ continue;
+ }
+ else
{
printf("ERROR: Failed to read file: %d\n", errno);
printf(" File name: %s\n", file->name);
@@ -556,6 +570,7 @@ static ssize_t fstest_rdblock(int fd, FAR struct fstest_filedesc_s *file,
printf(" Read size: %ld\n", (long)len);
return ERROR;
}
+ }
else if (nbytesread == 0)
{
#if 0 /* No... we do this on purpose sometimes */
@@ -579,6 +594,7 @@ static ssize_t fstest_rdblock(int fd, FAR struct fstest_filedesc_s *file,
return nbytesread;
}
+}
/****************************************************************************
* Name: fstest_rdfile
