aboutsummaryrefslogtreecommitdiff
path: root/libio/oldfileops.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /libio/oldfileops.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.zip
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.bz2
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'libio/oldfileops.c')
-rw-r--r--libio/oldfileops.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libio/oldfileops.c b/libio/oldfileops.c
index 3bd0aa1..b9efca7 100644
--- a/libio/oldfileops.c
+++ b/libio/oldfileops.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997-2004, 2005, 2007
- Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
@@ -272,7 +271,7 @@ _IO_old_file_setbuf (fp, p, len)
return fp;
}
-static int old_do_write (_IO_FILE *, const char *, _IO_size_t);
+static int old_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
/* Write TO_DO bytes from DATA to FP.
Then mark FP as having empty buffers. */
@@ -696,7 +695,7 @@ _IO_old_file_xsputn (f, data, n)
register const char *s = (char *) data;
_IO_size_t to_do = n;
int must_flush = 0;
- _IO_size_t count = 0;
+ _IO_size_t count;
if (n <= 0)
return 0;
@@ -705,6 +704,7 @@ _IO_old_file_xsputn (f, data, n)
(or the filebuf is unbuffered), use sys_write directly. */
/* First figure out how much space is available in the buffer. */
+ count = f->_IO_write_end - f->_IO_write_ptr; /* Space available. */
if ((f->_flags & _IO_LINE_BUF) && (f->_flags & _IO_CURRENTLY_PUTTING))
{
count = f->_IO_buf_end - f->_IO_write_ptr;
@@ -722,9 +722,6 @@ _IO_old_file_xsputn (f, data, n)
}
}
}
- else if (f->_IO_write_end > f->_IO_write_ptr)
- count = f->_IO_write_end - f->_IO_write_ptr; /* Space available. */
-
/* Then fill the buffer. */
if (count > 0)
{
@@ -755,7 +752,7 @@ _IO_old_file_xsputn (f, data, n)
_IO_size_t block_size, do_write;
/* Next flush the (full) buffer. */
if (__overflow (f, EOF) == EOF)
- return to_do == 0 ? EOF : n - to_do;
+ return n - to_do;
/* Try to maintain alignment: write a whole number of blocks.
dont_write is what gets left over. */