]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Hurd: O_CLOEXEC in rtld
authorThomas Schwinge <thomas@schwinge.name>
Thu, 10 May 2012 19:43:01 +0000 (12:43 -0700)
committerRoland McGrath <roland@hack.frob.com>
Thu, 10 May 2012 22:57:22 +0000 (15:57 -0700)
ChangeLog
hurd/hurd/fd.h
hurd/intern-fd.c
hurd/port2fd.c
sysdeps/mach/hurd/dl-sysdep.c

index 11ca6b7073f30e7d9ceaa9517b5fd2371b39ef2e..bd66d5a0eb1a6c17a9a32cda7ee4b31d18830d92 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+       * sysdeps/mach/hurd/dl-sysdep.c (open_file): Do not raise
+       assertion on O_CLOEXEC flag.
+       * hurd/hurd/fd.h: Update comment to mention O_CLOEXEC.
+       * hurd/intern-fd.c: Likewise.
+       * hurd/port2fd.c: Likewise.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
        [BZ #3906]
index 5f3ee6a8c9699b19b183bdd2894771c49e3a6d3b..5044f977fb55b66c020d526626c9251572de6978 100644 (file)
@@ -1,6 +1,5 @@
 /* File descriptors.
-   Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006,2007
-       Free Software Foundation, Inc.
+   Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -199,7 +198,8 @@ extern void _hurd_port2fd (struct hurd_fd *fd, io_t port, int flags);
 
 /* Allocate a new file descriptor and install PORT in it (doing any
    appropriate ctty magic); consumes a user reference on PORT.  FLAGS are
-   as for `open'; only O_IGNORE_CTTY is meaningful, but all are saved.
+   as for `open'; only O_IGNORE_CTTY and O_CLOEXEC are meaningful, but all are
+   saved.
 
    If the descriptor table is full, set errno, and return -1.
    If DEALLOC is nonzero, deallocate PORT first.  */
index 52e0606c966c7b74cfed404b5653c323daf729aa..ac891739422119a90eb8e13339f5e32718594cfc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
 #include <hurd/fd.h>
 
 /* Allocate a new file descriptor and install PORT in it.  FLAGS are as for
-   `open'; only O_IGNORE_CTTY is meaningful.
+   `open'; only O_IGNORE_CTTY and O_CLOEXEC are meaningful.
 
    If the descriptor table is full, set errno, and return -1.
    If DEALLOC is nonzero, deallocate PORT first.  */
index bef07ad3bf83ca913dd8ac3fffd9192242473d70..451d6306e7b956f5327def9afbb4a7200ed991ca 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997, 1999, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
 #include <fcntl.h>
 
 /* Store PORT in file descriptor D, doing appropriate ctty magic.
-   FLAGS are as for `open'; only O_IGNORE_CTTY is meaningful.
+   FLAGS are as for `open'; only O_IGNORE_CTTY and O_CLOEXEC are meaningful.
    D should be locked, and will not be unlocked.  */
 
 void
index d928cd247883a8050219d75a822b5891dd6b42c7..26a212ef98812d4f5501b0464e81ed934e7477d2 100644 (file)
@@ -1,6 +1,5 @@
 /* Operating system support for run-time dynamic linker.  Hurd version.
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2010
-       Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -315,7 +314,7 @@ open_file (const char *file_name, int flags,
       return MACH_PORT_NULL;
     }
 
-  assert (!(flags & ~O_READ));
+  assert (!(flags & ~(O_READ | O_CLOEXEC)));
 
   startdir = _dl_hurd_data->portarray[file_name[0] == '/' ?
                                      INIT_PORT_CRDIR : INIT_PORT_CWDIR];