From: Peter Tyser Date: Fri, 24 Apr 2009 15:59:46 -0500 Subject: [U-Boot] [PATCH] ncb: Check return value of write() Message-ID: <1240606786-32082-1-git-send-email-ptyser@xes-inc.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This prevents the compilation warning: ncb.c: In function 'main': ncb.c:32: warning: ignoring return value of ?write?, declared with attribute warn_unused_result Signed-off-by: Peter Tyser --- tools/ncb.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/ncb.c b/tools/ncb.c index 30acbea..ec8d8a7 100644 --- a/tools/ncb.c +++ b/tools/ncb.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -29,7 +30,8 @@ int main (int argc, char *argv[]) len = recvfrom (s, buf, sizeof buf, 0, (struct sockaddr *) &addr, &addr_len); if (len < 0) break; - write (1, buf, len); + if (write (1, buf, len) != len) + fprintf(stderr, "WARNING: serial characters dropped\n"); } return 0; -- 1.6.2.1