9
0
Fork 0

EINTR is not an error

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@289 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2007-06-11 22:47:21 +00:00
parent f328956ced
commit 1cb65a9f8d
1 changed files with 18 additions and 5 deletions

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;
}
}