Imported Upstream version 3.12.0

Former-commit-id: cf92446697332992ec36726e78eb8703e1f259d7
This commit is contained in:
Jo Shields
2015-01-13 10:44:36 +00:00
parent 8b9b85e7f5
commit 181b81b4a4
659 changed files with 12743 additions and 16300 deletions

View File

@ -176,7 +176,6 @@ typedef struct _GMemChunk GMemChunk;
/*
* Misc.
*/
#define g_atexit(func) ((void) atexit (func))
const gchar * g_getenv(const gchar *variable);
gboolean g_setenv(const gchar *variable, const gchar *value, gboolean overwrite);

View File

@ -176,7 +176,7 @@ default_stderr_handler (const gchar *message)
}
#elif MONOTOUCH
#elif defined(HOST_IOS)
#include <asl.h>
static int

View File

@ -53,6 +53,10 @@
#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#ifdef G_OS_WIN32
#include <io.h>
#include <winsock2.h>
@ -213,6 +217,23 @@ write_all (int fd, const void *vbuf, size_t n)
return nwritten;
}
#ifndef G_OS_WIN32
static int
g_getdtablesize (void)
{
#ifdef HAVE_GETRLIMIT
struct rlimit limit;
int res;
res = getrlimit (RLIMIT_NOFILE, &limit);
g_assert (res == 0);
return limit.rlim_cur;
#else
return getdtablesize ();
#endif
}
#endif
gboolean
g_spawn_command_line_sync (const gchar *command_line,
gchar **standard_output,
@ -256,7 +277,7 @@ g_spawn_command_line_sync (const gchar *command_line,
close (stderr_pipe [0]);
dup2 (stderr_pipe [1], STDERR_FILENO);
}
for (i = getdtablesize () - 1; i >= 3; i--)
for (i = g_getdtablesize () - 1; i >= 3; i--)
close (i);
/* G_SPAWN_SEARCH_PATH is always enabled for g_spawn_command_line_sync */
@ -417,7 +438,7 @@ g_spawn_async_with_pipes (const gchar *working_directory,
}
if ((flags & G_SPAWN_LEAVE_DESCRIPTORS_OPEN) != 0) {
for (i = getdtablesize () - 1; i >= 3; i--)
for (i = g_getdtablesize () - 1; i >= 3; i--)
close (i);
}