This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.16-ports-merge-841-g7728c57
- From: siddhesh at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 6 Dec 2012 05:44:06 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.16-ports-merge-841-g7728c57
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 7728c57488f3d75c6c2865ef36eae262daf8947a (commit)
from 17aa0516c859f3130f2339cc75c6d89a3f30161c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7728c57488f3d75c6c2865ef36eae262daf8947a
commit 7728c57488f3d75c6c2865ef36eae262daf8947a
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Thu Dec 6 11:10:18 2012 +0530
Add newline to last test in stdio-common/tst-put-error.c
The newline ensures that the buffer is flushed and the test executes
as expected.
diff --git a/ChangeLog b/ChangeLog
index 2f72afe..9be6120 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-06 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * stdio-common/tst-put-error.c (do_test): Add newline to the
+ padded test to ensure flush.
+
2012-12-05 Jeff Law <law@redhat.com>
* sunrpc/etc.rpc (fedfs_admin): Add entry.
diff --git a/stdio-common/tst-put-error.c b/stdio-common/tst-put-error.c
index 5209cce..71c1103 100644
--- a/stdio-common/tst-put-error.c
+++ b/stdio-common/tst-put-error.c
@@ -34,20 +34,30 @@ do_test (void)
FILE *fp = fdopen (fd, "w");
if (fp == NULL)
error (EXIT_FAILURE, errno, "fdopen");
+
+ /* All of the tests below verify that flushing buffers result in failure of
+ the fprintf calls. We ensure that the buffer is flushed at the end of
+ each fprintf call by doing two things - setting the file pointer to
+ line-buffered so that it is flushed whenever it encounters a newline and
+ then ensuring that there is a newline in each of the format strings we
+ pass to fprintf. */
+
setlinebuf (fp);
close (fd);
unlink (tmpl);
+
int n = fprintf (fp, "hello world\n");
printf ("fprintf = %d\n", n);
if (n >= 0)
error (EXIT_FAILURE, 0, "first fprintf succeeded");
+
n = fprintf (fp, "hello world\n");
printf ("fprintf = %d\n", n);
if (n >= 0)
error (EXIT_FAILURE, 0, "second fprintf succeeded");
/* Padded printing takes a different code path. */
- n = fprintf (fp, "%10000000s", "foo");
+ n = fprintf (fp, "%100s\n", "foo");
printf ("fprintf = %d\n", n);
if (n >= 0)
error (EXIT_FAILURE, 0, "padded fprintf succeeded");
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
stdio-common/tst-put-error.c | 12 +++++++++++-
2 files changed, 16 insertions(+), 1 deletions(-)
hooks/post-receive
--
GNU C Library master sources