[115816] trunk/dports/gnome/gnome-desktop/files/ patch-libgnome-destktop-libgsystem.diff

devans at macports.org devans at macports.org
Sat Jan 11 18:42:31 PST 2014


Revision: 115816
          https://trac.macports.org/changeset/115816
Author:   devans at macports.org
Date:     2014-01-11 18:42:31 -0800 (Sat, 11 Jan 2014)
Log Message:
-----------
gnome-desktop: additional SL build fixes, O_CLOEXEC, F_DUPFD_CLOEXEC unavailable.

Modified Paths:
--------------
    trunk/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff

Modified: trunk/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff
===================================================================
--- trunk/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff	2014-01-12 02:39:15 UTC (rev 115815)
+++ trunk/dports/gnome/gnome-desktop/files/patch-libgnome-destktop-libgsystem.diff	2014-01-12 02:42:31 UTC (rev 115816)
@@ -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	2014-01-11 15:28:58.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	2014-01-11 16:08:49.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>
@@ -55,8 +55,8 @@
  
 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-11 15:28:58.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
@@ -366,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 *);
@@ -629,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	2014-01-11 15:28:58.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
 + */
@@ -647,6 +655,15 @@
 +
 +#define O_SEARCH O_RDONLY
 +
++/*
++ * uncomment to simular 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 };
 +
@@ -676,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	2014-01-11 16:50:40.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>
@@ -794,3 +811,42 @@
      {
        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/20140111/80f5d607/attachment.html>


More information about the macports-changes mailing list