]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Report write error in addmnt even for cached streams.
authorUlrich Drepper <drepper@gmail.com>
Thu, 12 May 2011 03:37:25 +0000 (04:37 +0100)
committerPetr Baudis <pasky@ucw.cz>
Thu, 26 May 2011 23:24:24 +0000 (01:24 +0200)
(cherry picked from commit e1fb097f447a89aa69a926e45e673a52d86a6c57)

ChangeLog
misc/mntent_r.c

index 20a0c49deef118374249900d47e2a90ab915a381..ad835e65f7a43ad4f9164aff474f172485a86bd0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-05-11  Ulrich Drepper  <drepper@gmail.com>
 
+       [BZ #12625]
+       * misc/mntent_r.c (addmntent): Flush the stream after the output
+
        [BZ #12393]
        * elf/dl-load.c (is_trusted_path): Remove unnecessary test.
        (is_trusted_path_normalize): Skip initial colon.  Append slash
index 9598528324463a6bebf51df4628845c5fdee9b6f..6959f0e21d53f62cc048f66997ee7c62704fd8da 100644 (file)
@@ -1,5 +1,5 @@
 /* Utilities for reading/writing fstab, mtab, etc.
-   Copyright (C) 1995-2000, 2001, 2002, 2003, 2006, 2010
+   Copyright (C) 1995-2000, 2001, 2002, 2003, 2006, 2010, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -263,8 +263,8 @@ __addmntent (FILE *stream, const struct mntent *mnt)
                   mntcopy.mnt_type,
                   mntcopy.mnt_opts,
                   mntcopy.mnt_freq,
-                  mntcopy.mnt_passno)
-         < 0 ? 1 : 0);
+                  mntcopy.mnt_passno) < 0
+         || fflush (stream) != 0);
 }
 weak_alias (__addmntent, addmntent)