EINTR is not an error

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@289 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2007-06-11 22:47:21 +00:00
parent 576c4f55c2
commit 13bd9989b2

View File

@ -290,8 +290,13 @@ static void cmd_cat(int argc, char **argv)
if (nbytesread < 0)
{
printf(g_fmtcmdfailed, argv[0], "read", strerror(errno));
break;
/* EINTR is not an error */
if (errno != EINTR)
{
printf(g_fmtcmdfailed, argv[0], "read", strerror(errno));
break;
}
}
/* Check for data successfully read */
@ -306,10 +311,18 @@ static void cmd_cat(int argc, char **argv)
int n = write(1, buffer, nbytesread);
if (n < 0)
{
printf(g_fmtcmdfailed, argv[0], "write", strerror(errno));
break;
/* EINTR is not an error */
if (errno != EINTR)
{
printf(g_fmtcmdfailed, argv[0], "write", strerror(errno));
break;
}
}
else
{
nbyteswritten += n;
}
nbyteswritten += n;
}
}