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.10-375-gd79eccd


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  d79eccd6dd8aa2038a9775689a7072fe3ceb40dc (commit)
      from  22bc5239e1c7d97b0642af6c135af994586f8e82 (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=d79eccd6dd8aa2038a9775689a7072fe3ceb40dc

commit d79eccd6dd8aa2038a9775689a7072fe3ceb40dc
Author: Andreas Schwab <schwab@redhat.com>
Date:   Thu Oct 29 11:27:53 2009 -0700

    Fix errno handling in posix_openpt.
    
    The implementation of posix_openpt on Linux can fail in a few extra
    ways if the appropriate pseudo filesystems are not mounted etc.  In
    some of these cases we have to explicitly set errno.

diff --git a/ChangeLog b/ChangeLog
index 99088df..c46e962 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-27  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/unix/sysv/linux/getpt.c (__posix_openpt): Make sure
+	errno is always set when returning unsuccessfully.
+
 2009-10-29  Andreas Schwab  <schwab@redhat.com>
 
 	* malloc/memusage.c (update_data): Fix index wraparound handling
diff --git a/sysdeps/unix/sysv/linux/getpt.c b/sysdeps/unix/sysv/linux/getpt.c
index bb1ea47..6b26fdf 100644
--- a/sysdeps/unix/sysv/linux/getpt.c
+++ b/sysdeps/unix/sysv/linux/getpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2001, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
 
@@ -64,9 +64,10 @@ __posix_openpt (oflag)
 	    }
 
 	  /* If /dev/pts is not mounted then the UNIX98 pseudo terminals
-             are not usable.  */
+	     are not usable.  */
 	  __close (fd);
 	  have_no_dev_ptmx = 1;
+	  __set_errno (ENOENT);
 	}
       else
 	{
@@ -76,6 +77,8 @@ __posix_openpt (oflag)
 	    return -1;
 	}
     }
+  else
+    __set_errno (ENOENT);
 
   return -1;
 }

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

Summary of changes:
 ChangeLog                       |    5 +++++
 sysdeps/unix/sysv/linux/getpt.c |    7 +++++--
 2 files changed, 10 insertions(+), 2 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]