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

@ -289,10 +289,15 @@ static void cmd_cat(int argc, char **argv)
/* Check for read errors */
if (nbytesread < 0)
{
/* EINTR is not an error */
if (errno != EINTR)
{
printf(g_fmtcmdfailed, argv[0], "read", strerror(errno));
break;
}
}
/* Check for data successfully read */
@ -305,13 +310,21 @@ static void cmd_cat(int argc, char **argv)
{
int n = write(1, buffer, nbytesread);
if (n < 0)
{
/* EINTR is not an error */
if (errno != EINTR)
{
printf(g_fmtcmdfailed, argv[0], "write", strerror(errno));
break;
}
}
else
{
nbyteswritten += n;
}
}
}
/* Otherwise, it is the end of file */