[115829] users/devans/GNOME-3/stable/dports/gnome/gnome-desktop

devans at macports.org devans at macports.org
Sun Jan 12 08:54:56 PST 2014


Revision: 115829
          https://trac.macports.org/changeset/115829
Author:   devans at macports.org
Date:     2014-01-12 08:54:56 -0800 (Sun, 12 Jan 2014)
Log Message:
-----------
GNOME-3/stable/dports: gnome-desktop, sync with trunk.

Modified Paths:
--------------
    users/devans/GNOME-3/stable/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff

Property Changed:
----------------
    users/devans/GNOME-3/stable/dports/gnome/gnome-desktop/


Property changes on: users/devans/GNOME-3/stable/dports/gnome/gnome-desktop
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/dports/gnome/gnome-desktop:108265-113099
   + /trunk/dports/gnome/gnome-desktop:108265-115828

Modified: users/devans/GNOME-3/stable/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff
===================================================================
--- users/devans/GNOME-3/stable/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff	2014-01-12 14:58:13 UTC (rev 115828)
+++ users/devans/GNOME-3/stable/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff	2014-01-12 16:54:56 UTC (rev 115829)
@@ -1,6 +1,6 @@
 diff -urN libgnome-desktop/libgsystem.orig/Makefile-libgsystem.am libgnome-desktop/libgsystem/Makefile-libgsystem.am
 --- libgnome-desktop/libgsystem.orig/Makefile-libgsystem.am	2013-10-04 15:18:43.000000000 -0700
-+++ libgnome-desktop/libgsystem/Makefile-libgsystem.am	2013-12-12 16:16:36.000000000 -0800
++++ libgnome-desktop/libgsystem/Makefile-libgsystem.am	2014-01-11 18:24:46.000000000 -0800
 @@ -35,6 +35,8 @@
  	$(libgsystem_srcpath)/gsystem-subprocess.h \
  	$(libgsystem_srcpath)/gsystem-subprocess.c \
@@ -12,7 +12,7 @@
  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	2013-10-04 15:18:43.000000000 -0700
-+++ libgnome-desktop/libgsystem/gsystem-file-utils.c	2013-12-12 16:16:36.000000000 -0800
++++ libgnome-desktop/libgsystem/gsystem-file-utils.c	2014-01-11 18:24:46.000000000 -0800
 @@ -38,6 +38,10 @@
  #include <limits.h>
  #include <dirent.h>
@@ -24,10 +24,39 @@
  static int
  close_nointr (int fd)
  {
+@@ -444,12 +448,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	2013-12-12 16:31:06.000000000 -0800
-@@ -0,0 +1,570 @@
++++ libgnome-desktop/libgsystem/gsystem-osx-compat.c	2014-01-11 18:32:40.000000000 -0800
+@@ -0,0 +1,578 @@
 +/*
 + * Mac OS X compatibility functions
 + * Based on GNU lib compatibility library
@@ -337,7 +366,15 @@
 +int
 +dup_cloexec (int fd)
 +{
-+  return fcntl (fd, F_DUPFD_CLOEXEC, 0);
++  int dupfd;
++#ifdef F_DUPFD_CLOEXEC
++  dupfd = fcntl (fd, F_DUPFD_CLOEXEC, 0);
++#else
++  dupfd = fcntl (fd, F_DUPFD, 0);
++  if (dupfd > 0)
++      fcntl (dupfd, F_SETFD, FD_CLOEXEC);
++#endif
++  return dupfd;
 +}
 +
 +static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
@@ -600,8 +637,8 @@
 +
 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	2013-12-12 16:16:36.000000000 -0800
-@@ -0,0 +1,43 @@
++++ libgnome-desktop/libgsystem/gsystem-osx-compat.h	2014-01-11 18:24:46.000000000 -0800
+@@ -0,0 +1,52 @@
 +/*
 + * Mac OS X Compatibility
 + */
@@ -618,6 +655,15 @@
 +
 +#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 };
 +
@@ -647,7 +693,7 @@
 +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	2013-10-04 15:18:43.000000000 -0700
-+++ libgnome-desktop/libgsystem/gsystem-shutil.c	2013-12-12 16:16:36.000000000 -0800
++++ libgnome-desktop/libgsystem/gsystem-shutil.c	2014-01-11 18:24:46.000000000 -0800
 @@ -33,6 +33,11 @@
  #include <dirent.h>
  #include <fcntl.h>
@@ -672,3 +718,135 @@
              {
                int errsv = errno;
                if (errsv == ENOENT)
+@@ -271,6 +280,7 @@
+           
+       if (dent->d_type == DT_DIR)
+         {
++#ifdef O_CLOEXEC
+           int child_dfd = openat (dfd, dent->d_name, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW);
+ 
+           if (child_dfd == -1)
+@@ -285,7 +295,31 @@
+                   goto out;
+                 }
+             }
++#else
++          int child_dfd = openat (dfd, dent->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)
+             {
+@@ -352,9 +386,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;
+@@ -374,7 +408,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 > 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	2013-10-04 15:18:43.000000000 -0700
++++ libgnome-desktop/libgsystem/gsystem-subprocess.c	2014-01-11 18:24:46.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 && 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),
++                       "Error opening file '%s': %s", display_name,
++                       g_strerror (fc_error));
++          g_free (display_name);
++          /* fall through... */
++        }
++    }
++#endif
+ 
+   return my_fd;
+ }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140112/63f8f14e/attachment.html>


More information about the macports-changes mailing list