Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -58,7 +58,7 @@ int mkstemp (char *tmp_template)
utf16_template = _wmktemp( utf16_template);
if (utf16_template && *utf16_template) {
/* FIXME: _O_TEMPORARY causes file to disappear on close causing a test to fail */
fd = _wopen( utf16_template, _O_BINARY | _O_CREAT /*| _O_TEMPORARY*/ | _O_EXCL, _S_IREAD | _S_IWRITE);
fd = _wopen( utf16_template, _O_BINARY | _O_CREAT /*| _O_TEMPORARY*/ | _O_RDWR | _O_EXCL, _S_IREAD | _S_IWRITE);
}
/* FIXME: this will crash if utf16_template == NULL */

View File

@@ -814,6 +814,7 @@ gboolean g_spawn_command_line_sync (const gchar *command_line, gchar **standard_
gboolean g_spawn_async_with_pipes (const gchar *working_directory, gchar **argv, gchar **envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup,
gpointer user_data, GPid *child_pid, gint *standard_input, gint *standard_output, gint *standard_error, GError **error);
int eg_getdtablesize (void);
/*
* Timer

View File

@@ -132,6 +132,7 @@ g_assertion_message (const gchar *format, ...)
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
va_end (args);
exit (0);
}

View File

@@ -74,7 +74,7 @@
#define NO_INTR(var,cmd) do { (var) = (cmd); } while ((var) == -1 && errno == EINTR)
#define CLOSE_PIPE(p) do { close (p [0]); close (p [1]); } while (0)
#if defined(__APPLE__) && !defined (__arm__)
#if defined(__APPLE__) && !defined (__arm__) && !defined (__aarch64__)
/* Apple defines this in crt_externs.h but doesn't provide that header for
* arm-apple-darwin9. We'll manually define the symbol on Apple as it does
* in fact exist on all implementations (so far)
@@ -218,8 +218,8 @@ write_all (int fd, const void *vbuf, size_t n)
}
#ifndef G_OS_WIN32
static int
g_getdtablesize (void)
int
eg_getdtablesize (void)
{
#ifdef HAVE_GETRLIMIT
struct rlimit limit;
@@ -232,6 +232,12 @@ g_getdtablesize (void)
return getdtablesize ();
#endif
}
#else
int
eg_getdtablesize (void)
{
g_error ("Should not be called");
}
#endif
gboolean
@@ -277,7 +283,7 @@ g_spawn_command_line_sync (const gchar *command_line,
close (stderr_pipe [0]);
dup2 (stderr_pipe [1], STDERR_FILENO);
}
for (i = g_getdtablesize () - 1; i >= 3; i--)
for (i = eg_getdtablesize () - 1; i >= 3; i--)
close (i);
/* G_SPAWN_SEARCH_PATH is always enabled for g_spawn_command_line_sync */
@@ -438,7 +444,7 @@ g_spawn_async_with_pipes (const gchar *working_directory,
}
if ((flags & G_SPAWN_LEAVE_DESCRIPTORS_OPEN) != 0) {
for (i = g_getdtablesize () - 1; i >= 3; i--)
for (i = eg_getdtablesize () - 1; i >= 3; i--)
close (i);
}