about summary refs log tree commit diff
path: root/misc/mntent_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-11 23:37:25 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-11 23:37:25 -0400
commite1fb097f447a89aa69a926e45e673a52d86a6c57 (patch)
treee431e568618c083b271c55e0d91173af946c4fac /misc/mntent_r.c
parent5bdcc10322c488f53557440acf71623d8b313ab5 (diff)
downloadglibc-e1fb097f447a89aa69a926e45e673a52d86a6c57.tar.gz
glibc-e1fb097f447a89aa69a926e45e673a52d86a6c57.tar.xz
glibc-e1fb097f447a89aa69a926e45e673a52d86a6c57.zip
Report write error in addmnt even for cached streams.
Diffstat (limited to 'misc/mntent_r.c')
-rw-r--r--misc/mntent_r.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/mntent_r.c b/misc/mntent_r.c
index 9598528324..6959f0e21d 100644
--- a/misc/mntent_r.c
+++ b/misc/mntent_r.c
@@ -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)