This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Fix stdio unbuffered stream build issue
- From: jlarmour at ecoscentric dot com (Jonathan Larmour)
- To: ecos-patches at ecos dot sourceware dot org
- Date: Thu, 14 Apr 2005 17:41:52 +0100 (BST)
- Subject: Fix stdio unbuffered stream build issue
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdio/current/ChangeLog,v
retrieving revision 1.34
diff -u -5 -p -r1.34 ChangeLog
--- ChangeLog 27 Mar 2005 17:29:22 -0000 1.34
+++ ChangeLog 14 Apr 2005 16:41:51 -0000
@@ -1,5 +1,10 @@
+2005-04-11 Jonathan Larmour <jifl@eCosCentric.com>
+
+ * src/common/stream.cxx (read): don't reference flags.buffering
+ when configured by CDL to be unbuffered.
+
2005-03-27 Andrew Lunn <andrew.lunn@ascom.ch>
* include/stdio.h: Added CYGBLD_ATTRIB_{PRINTF|SCANF}_FORMAT where
appropriate so the compiler does more checking.
@@ -471,10 +476,11 @@
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2004 eCosCentric Limited
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
Index: src/common/stream.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdio/current/src/common/stream.cxx,v
retrieving revision 1.8
diff -u -5 -p -r1.8 stream.cxx
--- src/common/stream.cxx 16 Aug 2004 14:38:42 -0000 1.8
+++ src/common/stream.cxx 14 Apr 2005 16:41:51 -0000
@@ -392,11 +392,15 @@ Cyg_StdioStream::read( cyg_uint8 *user_b
// if we are unbuffered, we read as much as we can directly from the
// file system at this point.
//
// unless we do this, we could end up reading byte-by-byte from the filing system
// due to the readbuf_char scheme.
- if (!flags.buffering && (*bytes_read<buffer_length)) {
+ if (
+#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO
+ !flags.buffering &&
+#endif
+ (*bytes_read<buffer_length)) {
cyg_uint32 len;
len=buffer_length-*bytes_read;
read_err = cyg_stdio_read(my_device, user_buffer + *bytes_read, &len);
*bytes_read+=len;
}