<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[136093] trunk/dports/gnome/gnome-desktop</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/136093">136093</a></dd>
<dt>Author</dt> <dd>devans@macports.org</dd>
<dt>Date</dt> <dd>2015-05-11 12:14:51 -0700 (Mon, 11 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>gnome-desktop: update to version 3.16.1, reconfigure using upstream autogen.sh for intltool 0.51 compatibility.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsgnomegnomedesktopPortfile">trunk/dports/gnome/gnome-desktop/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsgnomegnomedesktopfilesautogensh">trunk/dports/gnome/gnome-desktop/files/autogen.sh</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkdportsgnomegnomedesktopfilespatchlibgnomedestktoplibgsystemdiff">trunk/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#trunkdportsgnomegnomedesktop">trunk/dports/gnome/gnome-desktop/</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsgnomegnomedesktop"></a>
<div class="propset"><h4>Property changes: trunk/dports/gnome/gnome-desktop</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/users/devans/GNOME-3/unstable/dports/gnome/gnome-desktop:116416-118152,119624-125621
</span><span class="cx">   + /users/devans/GNOME-3/stable/dports/gnome/gnome-desktop:108269-136044
</span><span class="cx">/users/devans/GNOME-3/unstable/dports/gnome/gnome-desktop:116416-118152,119624-125621,128305-134379
</span><a id="trunkdportsgnomegnomedesktopPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/gnome/gnome-desktop/Portfile (136092 => 136093)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/gnome/gnome-desktop/Portfile        2015-05-11 19:14:49 UTC (rev 136092)
+++ trunk/dports/gnome/gnome-desktop/Portfile        2015-05-11 19:14:51 UTC (rev 136093)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> PortGroup           gobject_introspection 1.0
</span><span class="cx"> 
</span><span class="cx"> name                gnome-desktop
</span><del>-version             3.14.2
</del><ins>+version             3.16.1
</ins><span class="cx"> set branch          [join [lrange [split ${version} .] 0 1] .]
</span><span class="cx"> maintainers         devans openmaintainer
</span><span class="cx"> categories          gnome
</span><span class="lines">@@ -25,13 +25,17 @@
</span><span class="cx"> 
</span><span class="cx"> use_xz              yes
</span><span class="cx"> 
</span><del>-checksums           rmd160  88c730cc6e3dbd373a04e6d214c1ef88a237bdcb \
-                    sha256  3c284378fd4d5c9aba1ef98b8bab78d0f7fe514964f9dfcfc3b1591328d6b873
</del><ins>+checksums           rmd160  fbf68d808e045d9f2c7fdc1bf735aaca217eda01 \
+                    sha256  4be6f5ff7480ccb8f160d4343a1cff800042e50758683b892c65dba59969f56c
</ins><span class="cx"> 
</span><span class="cx"> depends_build       port:pkgconfig \
</span><span class="cx">                     port:intltool \
</span><span class="cx">                     port:gnome-common \
</span><del>-                    port:gtk-doc
</del><ins>+                    port:gtk-doc \
+                    port:yelp-tools \
+                    port:autoconf \
+                    port:automake \
+                    port:libtool
</ins><span class="cx"> 
</span><span class="cx"> depends_lib         port:desktop-file-utils \
</span><span class="cx">                     port:gsettings-desktop-schemas \
</span><span class="lines">@@ -44,18 +48,15 @@
</span><span class="cx">                     port:xkeyboard-config \
</span><span class="cx">                     port:xorg-libxkbfile
</span><span class="cx"> 
</span><del>-patchfiles          patch-libgnome-destktop-libgsystem.diff
-
</del><span class="cx"> gobject_introspection yes
</span><span class="cx"> 
</span><del>-# update m4/intltool.m4 and autoreconf
</del><ins>+# reconfigure using upstream autogen.sh for intltool 0.51 compatibility
</ins><span class="cx"> 
</span><del>-pre-configure {
-    copy -force ${prefix}/share/aclocal/intltool.m4 ${worksrcpath}/m4
</del><ins>+post-patch {
+    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-use_autoreconf      yes
-autoreconf.args     -fvi
</del><ins>+configure.cmd       ./autogen.sh
</ins><span class="cx"> 
</span><span class="cx"> configure.args      --disable-maintainer-mode \
</span><span class="cx">                     --disable-silent-rules \
</span></span></pre></div>
<a id="trunkdportsgnomegnomedesktopfilesautogenshfromrev136044usersdevansGNOME3stabledportsgnomegnomedesktopfilesautogensh"></a>
<div class="copfile"><h4>Copied: trunk/dports/gnome/gnome-desktop/files/autogen.sh (from rev 136044, users/devans/GNOME-3/stable/dports/gnome/gnome-desktop/files/autogen.sh) (0 => 136093)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/gnome/gnome-desktop/files/autogen.sh                                (rev 0)
+++ trunk/dports/gnome/gnome-desktop/files/autogen.sh        2015-05-11 19:14:51 UTC (rev 136093)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z &quot;$srcdir&quot; &amp;&amp; srcdir=.
+
+PKG_NAME=&quot;gnome-desktop&quot;
+REQUIRED_AUTOMAKE_VERSION=1.9
+REQUIRED_M4MACROS=
+
+which gnome-autogen.sh || {
+    echo &quot;You need to install gnome-common.&quot;
+    exit 1
+}
+
+. gnome-autogen.sh
</ins></span></pre></div>
<a id="trunkdportsgnomegnomedesktopfilespatchlibgnomedestktoplibgsystemdiff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff (136092 => 136093)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff        2015-05-11 19:14:49 UTC (rev 136092)
+++ trunk/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff        2015-05-11 19:14:51 UTC (rev 136093)
</span><span class="lines">@@ -1,852 +0,0 @@
</span><del>-diff -urN libgnome-desktop/libgsystem.orig/Makefile-libgsystem.am libgnome-desktop/libgsystem/Makefile-libgsystem.am
---- libgnome-desktop/libgsystem.orig/Makefile-libgsystem.am        2014-01-15 13:06:25.000000000 -0800
-+++ libgnome-desktop/libgsystem/Makefile-libgsystem.am        2014-01-24 17:02:13.000000000 -0800
-@@ -35,6 +35,8 @@
-         $(libgsystem_srcpath)/gsystem-subprocess.h \
-         $(libgsystem_srcpath)/gsystem-subprocess.c \
-         $(libgsystem_srcpath)/libgsystem.h \
-+        $(libgsystem_srcpath)/gsystem-osx-compat.c \
-+        $(libgsystem_srcpath)/gsystem-osx-compat.h \
-         $(NULL)

- libgsystem_la_CFLAGS = $(AM_CFLAGS) $(libgsystem_cflags)
-diff -urN libgnome-desktop/libgsystem.orig/gsystem-file-utils.c libgnome-desktop/libgsystem/gsystem-file-utils.c
---- libgnome-desktop/libgsystem.orig/gsystem-file-utils.c        2014-01-15 13:06:25.000000000 -0800
-+++ libgnome-desktop/libgsystem/gsystem-file-utils.c        2014-01-24 17:02:13.000000000 -0800
-@@ -41,6 +41,10 @@
- #include &lt;attr/xattr.h&gt;
- #endif

-+#ifdef __APPLE__
-+#include &quot;gsystem-osx-compat.h&quot;
-+#endif
-+
- static int
- close_nointr (int fd)
- {
-@@ -454,12 +458,28 @@
-                      GError       **error)
- {
-   /* Linux specific probably */
-+#ifdef O_CLOEXEC
-   *out_fd = open (gs_file_get_path_cached (path), O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC);
-   if (*out_fd == -1)
-     {
-       _set_error_from_errno (error);
-       return FALSE;
-     }
-+#else
-+  *out_fd = open (gs_file_get_path_cached (path), O_RDONLY | O_NONBLOCK | O_DIRECTORY);
-+  if (*out_fd == -1)
-+    {
-+      _set_error_from_errno (error);
-+      return FALSE;
-+    }
-+  int fc_error = fcntl(*out_fd, F_SETFD, FD_CLOEXEC);
-+  if (fc_error != 0)
-+    {
-+      g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (fc_error),
-+                           g_strerror (fc_error));
-+      return FALSE;
-+    }
-+#endif
-   return TRUE;
- }

-diff -urN libgnome-desktop/libgsystem.orig/gsystem-osx-compat.c libgnome-desktop/libgsystem/gsystem-osx-compat.c
---- libgnome-desktop/libgsystem.orig/gsystem-osx-compat.c        1969-12-31 16:00:00.000000000 -0800
-+++ libgnome-desktop/libgsystem/gsystem-osx-compat.c        2014-01-24 17:02:13.000000000 -0800
-@@ -0,0 +1,578 @@
-+/*
-+ * Mac OS X compatibility functions
-+ * Based on GNU lib compatibility library
-+ */
-+
-+/* provide a replacement openat function
-+   Copyright (C) 2004-2013 Free Software Foundation, Inc.
-+
-+   This program is free software: you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.  */
-+
-+/* written by Jim Meyering */
-+
-+#include &lt;fcntl.h&gt;
-+#include &lt;stdio.h&gt;
-+#include &lt;stdarg.h&gt;
-+#include &lt;stddef.h&gt;
-+#include &lt;stdlib.h&gt;
-+#include &lt;unistd.h&gt;
-+#include &lt;dirent.h&gt;
-+#include &lt;string.h&gt;
-+#include &lt;sys/stat.h&gt;
-+#include &lt;errno.h&gt;
-+
-+#include &quot;gsystem-osx-compat.h&quot;
-+
-+int
-+openat (int fd, char const *file, int flags, ...)
-+{
-+  mode_t mode = 0;
-+
-+  if (flags &amp; O_CREAT)
-+    {
-+      va_list arg;
-+      va_start (arg, flags);
-+
-+      mode = (mode_t) va_arg (arg, int);
-+
-+      va_end (arg);
-+    }
-+
-+  return openat_permissive (fd, file, flags, mode, NULL);
-+}
-+
-+/* Like openat (FD, FILE, FLAGS, MODE), but if CWD_ERRNO is
-+   nonnull, set *CWD_ERRNO to an errno value if unable to save
-+   or restore the initial working directory.  This is needed only
-+   the first time remove.c's remove_dir opens a command-line
-+   directory argument.
-+
-+   If a previous attempt to restore the current working directory
-+   failed, then we must not even try to access a '.'-relative name.
-+   It is the caller's responsibility not to call this function
-+   in that case.  */
-+
-+int
-+openat_permissive (int fd, char const *file, int flags, mode_t mode,
-+                   int *cwd_errno)
-+{
-+  struct saved_cwd saved_cwd;
-+  int saved_errno;
-+  int err;
-+  bool save_ok;
-+
-+  if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
-+    return open (file, flags, mode);
-+
-+//  {
-+//    char buf[OPENAT_BUFFER_SIZE];
-+//    char *proc_file = openat_proc_name (buf, fd, file);
-+//    if (proc_file)
-+//      {
-+//        int open_result = open (proc_file, flags, mode);
-+//        int open_errno = errno;
-+//        if (proc_file != buf)
-+//          free (proc_file);
-+//        /* If the syscall succeeds, or if it fails with an unexpected
-+//           errno value, then return right away.  Otherwise, fall through
-+//           and resort to using save_cwd/restore_cwd.  */
-+//        if (0 &lt;= open_result || ! EXPECTED_ERRNO (open_errno))
-+//          {
-+//            errno = open_errno;
-+//            return open_result;
-+//          }
-+//      }
-+//  }
-+
-+  save_ok = (save_cwd (&amp;saved_cwd) == 0);
-+  if (! save_ok)
-+    {
-+      if (! cwd_errno)
-+        openat_save_fail (errno);
-+      *cwd_errno = errno;
-+    }
-+  if (0 &lt;= fd &amp;&amp; fd == saved_cwd.desc)
-+    {
-+      /* If saving the working directory collides with the user's
-+         requested fd, then the user's fd must have been closed to
-+         begin with.  */
-+      free_cwd (&amp;saved_cwd);
-+      errno = EBADF;
-+      return -1;
-+    }
-+
-+  err = fchdir (fd);
-+  saved_errno = errno;
-+
-+  if (! err)
-+    {
-+      err = open (file, flags, mode);
-+      saved_errno = errno;
-+      if (save_ok &amp;&amp; restore_cwd (&amp;saved_cwd) != 0)
-+        {
-+          if (! cwd_errno)
-+            {
-+              /* Don't write a message to just-created fd 2.  */
-+              saved_errno = errno;
-+              if (err == STDERR_FILENO)
-+                close (err);
-+              openat_restore_fail (saved_errno);
-+            }
-+          *cwd_errno = errno;
-+        }
-+    }
-+
-+  free_cwd (&amp;saved_cwd);
-+  errno = saved_errno;
-+  return err;
-+}
-+
-+/* Return true if our openat implementation must resort to
-+   using save_cwd and restore_cwd.  */
-+bool
-+openat_needs_fchdir (void)
-+{
-+  bool needs_fchdir = true;
-+//   int fd = open (&quot;/&quot;, O_SEARCH);
-+// 
-+//   if (0 &lt;= fd)
-+//     {
-+//       char buf[OPENAT_BUFFER_SIZE];
-+//       char *proc_file = openat_proc_name (buf, fd, &quot;.&quot;);
-+//       if (proc_file)
-+//         {
-+//           needs_fchdir = false;
-+//           if (proc_file != buf)
-+//             free (proc_file);
-+//         }
-+//       close (fd);
-+//     }
-+// 
-+  return needs_fchdir;
-+}
-+
-+/* save-cwd.c -- Save and restore current working directory.
-+
-+   Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2013 Free Software
-+   Foundation, Inc.
-+
-+   This program is free software: you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.  */
-+
-+/* Written by Jim Meyering.  */
-+
-+/* Record the location of the current working directory in CWD so that
-+   the program may change to other directories and later use restore_cwd
-+   to return to the recorded location.  This function may allocate
-+   space using malloc (via getcwd) or leave a file descriptor open;
-+   use free_cwd to perform the necessary free or close.  Upon failure,
-+   no memory is allocated, any locally opened file descriptors are
-+   closed;  return non-zero -- in that case, free_cwd need not be
-+   called, but doing so is ok.  Otherwise, return zero.
-+
-+   The _raison d'etre_ for this interface is that the working directory
-+   is sometimes inaccessible, and getcwd is not robust or as efficient.
-+   So, we prefer to use the open/fchdir approach, but fall back on
-+   getcwd if necessary.  This module works for most cases with just
-+   the getcwd-lgpl module, but to be truly robust, use the getcwd module.
-+
-+   Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin,
-+   SCO Xenix.  Also, SunOS 4 and Irix 5.3 provide the function, yet it
-+   doesn't work for partitions on which auditing is enabled.  If
-+   you're still using an obsolete system with these problems, please
-+   send email to the maintainer of this code.  */
-+
-+int
-+save_cwd (struct saved_cwd *cwd)
-+{
-+  cwd-&gt;name = NULL;
-+
-+  cwd-&gt;desc = open (&quot;.&quot;, O_SEARCH);
-+  
-+  if (cwd-&gt;desc &lt; 0)
-+    {
-+      cwd-&gt;name = getcwd (NULL, 0);
-+      return cwd-&gt;name ? 0 : -1;
-+    }
-+
-+  set_cloexec_flag (cwd-&gt;desc, true);
-+  return 0;
-+}
-+
-+/* Change to recorded location, CWD, in directory hierarchy.
-+   Upon failure, return -1 (errno is set by chdir or fchdir).
-+   Upon success, return zero.  */
-+
-+int
-+restore_cwd (const struct saved_cwd *cwd)
-+{
-+  return fchdir (cwd-&gt;desc);
-+}
-+
-+void
-+free_cwd (struct saved_cwd *cwd)
-+{
-+  if (cwd-&gt;desc &gt;= 0)
-+    close (cwd-&gt;desc);
-+  free (cwd-&gt;name);
-+}
-+
-+void
-+openat_save_fail (int errnum)
-+{
-+   printf(&quot;Unable to record current working directory: error %d&quot;, errnum);
-+   exit(1);
-+}
-+
-+
-+void
-+openat_restore_fail (int errnum)
-+{
-+   printf(&quot;Failed to return to initial working directory: error %d&quot;, errnum);
-+   exit(1);
-+}
-+
-+/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
-+   or clear the flag if VALUE is false.
-+   Return 0 on success, or -1 on error with 'errno' set.
-+
-+   Note that on MingW, this function does NOT protect DESC from being
-+   inherited into spawned children.  Instead, either use dup_cloexec
-+   followed by closing the original DESC, or use interfaces such as
-+   open or pipe2 that accept flags like O_CLOEXEC to create DESC
-+   non-inheritable in the first place.  */
-+
-+int
-+set_cloexec_flag (int desc, bool value)
-+{
-+#ifdef F_SETFD
-+
-+  int flags = fcntl (desc, F_GETFD, 0);
-+
-+  if (0 &lt;= flags)
-+    {
-+      int newflags = (value ? flags | FD_CLOEXEC : flags &amp; ~FD_CLOEXEC);
-+
-+      if (flags == newflags
-+          || fcntl (desc, F_SETFD, newflags) != -1)
-+        return 0;
-+    }
-+
-+  return -1;
-+
-+#else /* !F_SETFD */
-+
-+  /* Use dup2 to reject invalid file descriptors; the cloexec flag
-+     will be unaffected.  */
-+  if (desc &lt; 0)
-+    {
-+      errno = EBADF;
-+      return -1;
-+    }
-+  if (dup2 (desc, desc) &lt; 0)
-+    /* errno is EBADF here.  */
-+    return -1;
-+
-+  /* There is nothing we can do on this kind of platform.  Punt.  */
-+  return 0;
-+#endif /* !F_SETFD */
-+}
-+
-+
-+/* Duplicates a file handle FD, while marking the copy to be closed
-+   prior to exec or spawn.  Returns -1 and sets errno if FD could not
-+   be duplicated.  */
-+
-+int
-+dup_cloexec (int fd)
-+{
-+  int dupfd;
-+#ifdef F_DUPFD_CLOEXEC
-+  dupfd = fcntl (fd, F_DUPFD_CLOEXEC, 0);
-+#else
-+  dupfd = fcntl (fd, F_DUPFD, 0);
-+  if (dupfd &gt; 0)
-+      fcntl (dupfd, F_SETFD, FD_CLOEXEC);
-+#endif
-+  return dupfd;
-+}
-+
-+static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
-+static DIR *fd_clone_opendir (int, struct saved_cwd const *);
-+
-+/* Replacement for POSIX fdopendir.
-+
-+   First, try to simulate it via opendir (&quot;/proc/self/fd/...&quot;).  Failing
-+   that, simulate it by using fchdir metadata, or by doing
-+   save_cwd/fchdir/opendir(&quot;.&quot;)/restore_cwd.
-+   If either the save_cwd or the restore_cwd fails (relatively unlikely),
-+   then give a diagnostic and exit nonzero.
-+
-+   If successful, the resulting stream is based on FD in
-+   implementations where streams are based on file descriptors and in
-+   applications where no other thread or signal handler allocates or
-+   frees file descriptors.  In other cases, consult dirfd on the result
-+   to find out whether FD is still being used.
-+
-+   Otherwise, this function works just like POSIX fdopendir.
-+
-+   W A R N I N G:
-+
-+   Unlike other fd-related functions, this one places constraints on FD.
-+   If this function returns successfully, FD is under control of the
-+   dirent.h system, and the caller should not close or modify the state of
-+   FD other than by the dirent.h functions.  */
-+DIR *
-+fdopendir (int fd)
-+{
-+  DIR *dir = fdopendir_with_dup (fd, -1, NULL);
-+
-+  if (!dir)
-+    {
-+      int saved_errno = errno;
-+      if (EXPECTED_ERRNO (saved_errno))
-+        {
-+          struct saved_cwd cwd;
-+          if (save_cwd (&amp;cwd) != 0)
-+            openat_save_fail (errno);
-+          dir = fdopendir_with_dup (fd, -1, &amp;cwd);
-+          saved_errno = errno;
-+          free_cwd (&amp;cwd);
-+          errno = saved_errno;
-+        }
-+    }
-+
-+  return dir;
-+}
-+
-+/* Like fdopendir, except that if OLDER_DUPFD is not -1, it is known
-+   to be a dup of FD which is less than FD - 1 and which will be
-+   closed by the caller and not otherwise used by the caller.  This
-+   function makes sure that FD is closed and all file descriptors less
-+   than FD are open, and then calls fd_clone_opendir on a dup of FD.
-+   That way, barring race conditions, fd_clone_opendir returns a
-+   stream whose file descriptor is FD.
-+
-+   If REPLACE_CHDIR or CWD is null, use opendir (&quot;/proc/self/fd/...&quot;,
-+   falling back on fchdir metadata.  Otherwise, CWD is a saved version
-+   of the working directory; use fchdir/opendir(&quot;.&quot;)/restore_cwd(CWD).  */
-+static DIR *
-+fdopendir_with_dup (int fd, int older_dupfd, struct saved_cwd const *cwd)
-+{
-+  int dupfd = dup (fd);
-+  if (dupfd &lt; 0 &amp;&amp; errno == EMFILE)
-+    dupfd = older_dupfd;
-+  if (dupfd &lt; 0)
-+    return NULL;
-+  else
-+    {
-+      DIR *dir;
-+      int saved_errno;
-+      if (dupfd &lt; fd - 1 &amp;&amp; dupfd != older_dupfd)
-+        {
-+          dir = fdopendir_with_dup (fd, dupfd, cwd);
-+          saved_errno = errno;
-+        }
-+      else
-+        {
-+          close (fd);
-+          dir = fd_clone_opendir (dupfd, cwd);
-+          saved_errno = errno;
-+          if (! dir)
-+            {
-+              int fd1 = dup (dupfd);
-+              if (fd1 != fd)
-+                openat_save_fail (fd1 &lt; 0 ? errno : EBADF);
-+            }
-+        }
-+
-+      if (dupfd != older_dupfd)
-+        close (dupfd);
-+      errno = saved_errno;
-+      return dir;
-+    }
-+}
-+
-+/* Like fdopendir, except the result controls a clone of FD.  It is
-+   the caller's responsibility both to close FD and (if the result is
-+   not null) to closedir the result.  */
-+static DIR *
-+fd_clone_opendir (int fd, struct saved_cwd const *cwd)
-+{
-+   if (fchdir (fd) != 0)
-+      return NULL;
-+   else
-+      {
-+          DIR *dir = opendir (&quot;.&quot;);
-+          int saved_errno = errno;
-+          if (restore_cwd (cwd) != 0)
-+            openat_restore_fail (errno);
-+          errno = saved_errno;
-+          return dir;
-+      }
-+}
-+
-+/* Replacement for Solaris' function by the same name.
-+   &lt;http://www.google.com/search?q=unlinkat+site:docs.sun.com&gt;
-+   First, try to simulate it via (unlink|rmdir) (&quot;/proc/self/fd/FD/FILE&quot;).
-+   Failing that, simulate it via save_cwd/fchdir/(unlink|rmdir)/restore_cwd.
-+   If either the save_cwd or the restore_cwd fails (relatively unlikely),
-+   then give a diagnostic and exit nonzero.
-+   Otherwise, this function works just like Solaris' unlinkat.  */
-+
-+# define AT_FUNC_NAME unlinkat
-+# define AT_FUNC_F1 rmdir
-+# define AT_FUNC_F2 unlink
-+# define AT_FUNC_USE_F1_COND AT_REMOVEDIR
-+# define AT_FUNC_POST_FILE_PARAM_DECLS , int flag
-+# define AT_FUNC_POST_FILE_ARGS        /* empty */
-+
-+// # include &quot;at-func.c&quot;
-+
-+#ifdef AT_FUNC_USE_F1_COND
-+# define CALL_FUNC(F)                           \
-+  (flag == AT_FUNC_USE_F1_COND                  \
-+    ? AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS)     \
-+    : AT_FUNC_F2 (F AT_FUNC_POST_FILE_ARGS))
-+# define VALIDATE_FLAG(F)                       \
-+  if (flag &amp; ~AT_FUNC_USE_F1_COND)              \
-+    {                                           \
-+      errno = EINVAL;                           \
-+      return FUNC_FAIL;                         \
-+    }
-+#else
-+# define CALL_FUNC(F) (AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS))
-+# define VALIDATE_FLAG(F) /* empty */
-+#endif
-+
-+#ifdef AT_FUNC_RESULT
-+# define FUNC_RESULT AT_FUNC_RESULT
-+#else
-+# define FUNC_RESULT int
-+#endif
-+
-+#ifdef AT_FUNC_FAIL
-+# define FUNC_FAIL AT_FUNC_FAIL
-+#else
-+# define FUNC_FAIL -1
-+#endif
-+
-+/* Call AT_FUNC_F1 to operate on FILE, which is in the directory
-+   open on descriptor FD.  If AT_FUNC_USE_F1_COND is defined to a value,
-+   AT_FUNC_POST_FILE_PARAM_DECLS must include a parameter named flag;
-+   call AT_FUNC_F2 if FLAG is 0 or fail if FLAG contains more bits than
-+   AT_FUNC_USE_F1_COND.  Return int and fail with -1 unless AT_FUNC_RESULT
-+   or AT_FUNC_FAIL are defined.  If possible, do it without changing the
-+   working directory.  Otherwise, resort to using save_cwd/fchdir,
-+   then AT_FUNC_F?/restore_cwd.  If either the save_cwd or the restore_cwd
-+   fails, then give a diagnostic and exit nonzero.  */
-+FUNC_RESULT
-+AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
-+{
-+  VALIDATE_FLAG (flag);
-+
-+  if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
-+    return CALL_FUNC (file);
-+
-+#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
-+  errno = ENOTSUP;
-+  return FUNC_FAIL;
-+#else
-+  {
-+  /* Be careful to choose names unlikely to conflict with
-+     AT_FUNC_POST_FILE_PARAM_DECLS.  */
-+  struct saved_cwd saved_cwd;
-+  int saved_errno;
-+  FUNC_RESULT err;
-+
-+//  {
-+//    char proc_buf[OPENAT_BUFFER_SIZE];
-+//    char *proc_file = openat_proc_name (proc_buf, fd, file);
-+//    if (proc_file)
-+//      {
-+//        FUNC_RESULT proc_result = CALL_FUNC (proc_file);
-+//        int proc_errno = errno;
-+//        if (proc_file != proc_buf)
-+//          free (proc_file);
-+//        /* If the syscall succeeds, or if it fails with an unexpected
-+//           errno value, then return right away.  Otherwise, fall through
-+//           and resort to using save_cwd/restore_cwd.  */
-+//        if (FUNC_FAIL != proc_result)
-+//          return proc_result;
-+//        if (! EXPECTED_ERRNO (proc_errno))
-+//          {
-+//            errno = proc_errno;
-+//            return proc_result;
-+//          }
-+//      }
-+//  }
-+
-+  if (save_cwd (&amp;saved_cwd) != 0)
-+    openat_save_fail (errno);
-+  if (0 &lt;= fd &amp;&amp; fd == saved_cwd.desc)
-+    {
-+      /* If saving the working directory collides with the user's
-+         requested fd, then the user's fd must have been closed to
-+         begin with.  */
-+      free_cwd (&amp;saved_cwd);
-+      errno = EBADF;
-+      return FUNC_FAIL;
-+    }
-+
-+  if (fchdir (fd) != 0)
-+    {
-+      saved_errno = errno;
-+      free_cwd (&amp;saved_cwd);
-+      errno = saved_errno;
-+      return FUNC_FAIL;
-+    }
-+
-+  err = CALL_FUNC (file);
-+  saved_errno = (err == FUNC_FAIL ? errno : 0);
-+
-+  if (restore_cwd (&amp;saved_cwd) != 0)
-+    openat_restore_fail (errno);
-+
-+  free_cwd (&amp;saved_cwd);
-+
-+  if (saved_errno)
-+    errno = saved_errno;
-+  return err;
-+  }
-+#endif
-+}
-+#undef CALL_FUNC
-+#undef FUNC_RESULT
-+#undef FUNC_FAIL
-+
-+
-+// End include at-func.c
-+
-+# undef AT_FUNC_NAME
-+# undef AT_FUNC_F1
-+# undef AT_FUNC_F2
-+# undef AT_FUNC_USE_F1_COND
-+# undef AT_FUNC_POST_FILE_PARAM_DECLS
-+# undef AT_FUNC_POST_FILE_ARGS
-+
-diff -urN libgnome-desktop/libgsystem.orig/gsystem-osx-compat.h libgnome-desktop/libgsystem/gsystem-osx-compat.h
---- libgnome-desktop/libgsystem.orig/gsystem-osx-compat.h        1969-12-31 16:00:00.000000000 -0800
-+++ libgnome-desktop/libgsystem/gsystem-osx-compat.h        2014-01-24 17:02:13.000000000 -0800
-@@ -0,0 +1,52 @@
-+/*
-+ * Mac OS X Compatibility
-+ */
-+
-+#define IS_ABSOLUTE_FILE_NAME(name) (*name == '/')
-+#define AT_FDCWD 0
-+#define AT_REMOVEDIR 0
-+
-+#define EXPECTED_ERRNO(Errno)                   \
-+  ((Errno) == ENOTDIR || (Errno) == ENOENT      \
-+   || (Errno) == EPERM || (Errno) == EACCES     \
-+   || (Errno) == ENOSYS /* Solaris 8 */         \
-+   || (Errno) == EOPNOTSUPP /* FreeBSD */)
-+
-+#define O_SEARCH O_RDONLY
-+
-+/*
-+ * uncomment to simulate unavailability
-+ * of O_CLOEXEC F_DUPFD_CLOEXEC
-+ * as on OS X 10.6 and earlier
-+ */
-+
-+//#undef O_CLOEXEC
-+//#undef F_DUPFD_CLOEXEC
-+
-+typedef int bool;
-+enum { false, true };
-+
-+bool openat_needs_fchdir (void);
-+
-+int openat (int fd, char const *file, int flags, ...);
-+int openat_permissive (int fd, char const *file, int flags, mode_t mode, int *cwd_errno);
-+
-+struct saved_cwd {
-+    int desc;
-+    char *name;
-+};
-+
-+int save_cwd (struct saved_cwd *cwd);
-+int restore_cwd (const struct saved_cwd *cwd);
-+void free_cwd (struct saved_cwd *cwd);
-+
-+void openat_save_fail (int errnum);
-+void openat_restore_fail (int errnum);
-+
-+int set_cloexec_flag (int desc, bool value);
-+int dup_cloexec (int fd);
-+
-+int fdatasync(int fildes);
-+int unlinkat(int fd, const char *path, int flag);
-+
-+DIR *fdopendir(int fd);
-diff -urN libgnome-desktop/libgsystem.orig/gsystem-shutil.c libgnome-desktop/libgsystem/gsystem-shutil.c
---- libgnome-desktop/libgsystem.orig/gsystem-shutil.c        2014-01-15 13:06:25.000000000 -0800
-+++ libgnome-desktop/libgsystem/gsystem-shutil.c        2014-01-24 17:02:13.000000000 -0800
-@@ -33,6 +33,11 @@
- #include &lt;dirent.h&gt;
- #include &lt;fcntl.h&gt;

-+#ifdef __APPLE__
-+#include &quot;gsystem-osx-compat.h&quot;
-+#endif
-+
-+
- /* Taken from systemd/src/shared/util.h */
- union dirent_storage {
-         struct dirent dent;
-@@ -299,7 +304,11 @@
-       if (dent-&gt;d_type == DT_UNKNOWN)
-         {
-           struct stat stbuf;
-+#ifdef __APPLE__
-+          if (lstat (dent-&gt;d_name, &amp;stbuf) == -1)
-+#else
-           if (fstatat (dfd, dent-&gt;d_name, &amp;stbuf, AT_SYMLINK_NOFOLLOW) == -1)
-+#endif
-             {
-               int errsv = errno;
-               if (errsv == ENOENT)
-@@ -322,6 +331,7 @@
-           
-       if (dent-&gt;d_type == DT_DIR)
-         {
-+#ifdef O_CLOEXEC
-           int child_dfd = openat (dfd, dent-&gt;d_name, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW);

-           if (child_dfd == -1)
-@@ -336,7 +346,31 @@
-                   goto out;
-                 }
-             }
-+#else
-+          int child_dfd = openat (dfd, dent-&gt;d_name, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_NOFOLLOW);
-+
-+          if (child_dfd == -1)
-+            {
-+              if (errno == ENOENT)
-+                continue;
-+              else
-+                {
-+                  int errsv = errno;
-+                  g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (errsv),
-+                                       g_strerror (errsv));
-+                  goto out;
-+                }
-+            }

-+          int fc_error = fcntl(child_dfd, F_SETFD, FD_CLOEXEC);
-+          
-+          if (fc_error != 0)
-+            {
-+                  g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (fc_error),
-+                                       g_strerror (fc_error));
-+                  goto out;
-+            }
-+#endif
-           child_dir = fdopendir (child_dfd);
-           if (!child_dir)
-             {
-@@ -403,9 +437,9 @@
-   DIR *d = NULL;

-   /* With O_NOFOLLOW first */
-+#ifdef O_CLOEXEC
-   dfd = openat (AT_FDCWD, gs_file_get_path_cached (path),
-                 O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW);
--
-   if (dfd == -1)
-     {
-       int errsv = errno;
-@@ -425,7 +459,40 @@
-           goto out;
-         }
-     }
--  else
-+#else
-+  dfd = openat (AT_FDCWD, gs_file_get_path_cached (path),
-+                O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_NOFOLLOW);
-+  if (dfd == -1)
-+    {
-+      int errsv = errno;
-+      if (errsv == ENOENT)
-+        {
-+          ;
-+        }
-+      else if (errsv == ENOTDIR || errsv == ELOOP)
-+        {
-+          if (!gs_file_unlink (path, cancellable, error))
-+            goto out;
-+        }
-+      else
-+        {
-+          g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (errsv),
-+                               g_strerror (errsv));
-+          goto out;
-+        }
-+    }
-+
-+  int fc_error = fcntl(dfd, F_SETFD, FD_CLOEXEC);
-+  
-+  if (fc_error != 0)
-+    {
-+      g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (fc_error),
-+                           g_strerror (fc_error));
-+      goto out;
-+    }
-+
-+#endif
-+  if (dfd &gt; 0)
-     {
-       d = fdopendir (dfd);
-       if (!d)
-diff -urN libgnome-desktop/libgsystem.orig/gsystem-subprocess.c libgnome-desktop/libgsystem/gsystem-subprocess.c
---- libgnome-desktop/libgsystem.orig/gsystem-subprocess.c        2014-01-15 13:06:25.000000000 -0800
-+++ libgnome-desktop/libgsystem/gsystem-subprocess.c        2014-01-24 17:02:13.000000000 -0800
-@@ -259,7 +259,11 @@
-   gint my_fd;

-   do
-+#ifdef O_CLOEXEC
-     my_fd = open (filename, mode | O_BINARY | O_CLOEXEC, 0666);
-+#else
-+    my_fd = open (filename, mode | O_BINARY, 0666);
-+#endif
-   while (my_fd == -1 &amp;&amp; errno == EINTR);

-   /* If we return -1 we should also set the error */
-@@ -275,6 +279,23 @@
-       g_free (display_name);
-       /* fall through... */
-     }
-+#ifndef O_CLOEXEC
-+  else
-+    {
-+      int fc_error = fcntl(my_fd, F_SETFD, FD_CLOEXEC);
-+      if (fc_error != 0)
-+        {
-+          char *display_name;
-+
-+          display_name = g_filename_display_name (filename);
-+          g_set_error (error, G_IO_ERROR, g_io_error_from_errno (fc_error),
-+                       &quot;Error opening file '%s': %s&quot;, display_name,
-+                       g_strerror (fc_error));
-+          g_free (display_name);
-+          /* fall through... */
-+        }
-+    }
-+#endif

-   return my_fd;
- }
</del></span></pre>
</div>
</div>

</body>
</html>