This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.21-217-g7e9c7b9


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  7e9c7b9b689d9d8f24a4a7f9723f0290c0cbdbd0 (commit)
      from  98734cc50153c80047f4ed9c6772bc7e1e68c9f7 (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7e9c7b9b689d9d8f24a4a7f9723f0290c0cbdbd0

commit 7e9c7b9b689d9d8f24a4a7f9723f0290c0cbdbd0
Author: Roland McGrath <roland@hack.frob.com>
Date:   Mon Mar 23 13:46:36 2015 -0700

    Minor cleanups in libio/iofdopen.c

diff --git a/ChangeLog b/ChangeLog
index 5686701..b0a17b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-23  Roland McGrath  <roland@hack.frob.com>
+
+	* libio/iofdopen.c: Move FD_FLAGS declaration into its first use,
+	inside [F_GETFL].  Remove POSIX_MODE local variable, just test the
+	_IO_IS_APPENDING bit in READ_WRITE instead.
+
 2015-03-23  Florian Weimer  <fweimer@redhat.com>
 
 	* sysdeps/unix/sysv/linux/pthread_setaffinity.c
diff --git a/libio/iofdopen.c b/libio/iofdopen.c
index 411b689..e7d84ae 100644
--- a/libio/iofdopen.c
+++ b/libio/iofdopen.c
@@ -46,7 +46,6 @@ _IO_new_fdopen (fd, mode)
      const char *mode;
 {
   int read_write;
-  int posix_mode = 0;
   struct locked_FILE
   {
     struct _IO_FILE_plus fp;
@@ -55,7 +54,6 @@ _IO_new_fdopen (fd, mode)
 #endif
     struct _IO_wide_data wd;
   } *new_f;
-  int fd_flags;
   int i;
   int use_mmap = 0;
 
@@ -73,7 +71,6 @@ _IO_new_fdopen (fd, mode)
       read_write = _IO_NO_READS;
       break;
     case 'a':
-      posix_mode = O_APPEND;
       read_write = _IO_NO_READS|_IO_IS_APPENDING;
       break;
     default:
@@ -101,7 +98,7 @@ _IO_new_fdopen (fd, mode)
       break;
     }
 #ifdef F_GETFL
-  fd_flags = _IO_fcntl (fd, F_GETFL);
+  int fd_flags = _IO_fcntl (fd, F_GETFL);
 #ifndef O_ACCMODE
 #define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
 #endif
@@ -120,9 +117,9 @@ _IO_new_fdopen (fd, mode)
      Realtime Extensions], Rationale B.8.3.3
      Open a Stream on a File Descriptor says:
 
-         Although not explicitly required by POSIX.1, a good
-         implementation of append ("a") mode would cause the
-         O_APPEND flag to be set.
+	 Although not explicitly required by POSIX.1, a good
+	 implementation of append ("a") mode would cause the
+	 O_APPEND flag to be set.
 
      (Historical implementations [such as Solaris2] do a one-time
      seek in fdopen.)
@@ -131,7 +128,7 @@ _IO_new_fdopen (fd, mode)
      though that would seem consistent) because that would be more
      likely to break historical programs.
      */
-  if ((posix_mode & O_APPEND) && !(fd_flags & O_APPEND))
+  if ((read_write & _IO_IS_APPENDING) && !(fd_flags & O_APPEND))
     {
       do_seek = true;
 #ifdef F_SETFL

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |    6 ++++++
 libio/iofdopen.c |   13 +++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]