diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-06-11 22:47:21 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-06-11 22:47:21 +0000 |
commit | 4a0669bf9f46a8bf10d436ba426c840900788412 (patch) | |
tree | 046eb5749ec2e7a3301bd8486490416d0b2eb87c /nuttx/examples | |
parent | d89edd3c6e481c742e0d0bc9a60379f12fd90964 (diff) | |
download | px4-nuttx-4a0669bf9f46a8bf10d436ba426c840900788412.tar.gz px4-nuttx-4a0669bf9f46a8bf10d436ba426c840900788412.tar.bz2 px4-nuttx-4a0669bf9f46a8bf10d436ba426c840900788412.zip |
EINTR is not an error
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@289 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples')
-rw-r--r-- | nuttx/examples/nsh/nsh_main.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/nuttx/examples/nsh/nsh_main.c b/nuttx/examples/nsh/nsh_main.c index 16d633718..a6560614e 100644 --- a/nuttx/examples/nsh/nsh_main.c +++ b/nuttx/examples/nsh/nsh_main.c @@ -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; } } |