Commit Graph

15 Commits

Author SHA1 Message Date
Nirbheek Chauhan
91c9cb5a52 config.h.meson: Add some missing #mesondefines
The compiler checks were being completely ignored.
2018-05-09 18:04:09 +05:30
Xavier Claessens
01e8396301 Fix build when pthread_getname_np is not available
On Android _setname_ is always available but _getname_ is available only
with API level >= 26.

https://bugzilla.gnome.org/show_bug.cgi?id=795406
2018-04-25 13:56:14 -04:00
Xavier Claessens
7efd76dd67 struct ip_mreq_source definition is broken on Android NDK <= r16
This fix the build on Android r16 and older, see:
https://issuetracker.google.com/issues/36987220

https://bugzilla.gnome.org/show_bug.cgi?id=740791
2018-04-24 15:00:17 -04:00
Philip Withnall
723ac89b0c tests: Add a GFileMonitor test for G_FILE_MONITOR_WATCH_HARD_LINKS
Add a test for monitoring an existing local file, with the
WATCH_HARD_LINKS flag specified. This would previously cause a crash;
now it doesn’t.

This test contains a FIXME where I suspect we should be getting some
additional file change notifications from changes made through the hard
link; this requires further follow up and probably further fixes to our
inotify backend.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=755721
2018-04-18 15:13:02 +01:00
Philip Withnall
40be86bb0e gio: Port GThreadedResolver to use res_nquery() to fix thread-safety
res_query() uses global state in the form of the struct __res_state
which contains the contents of resolv.conf (and other things). On Linux,
this state seems to be thread-local, so there is no problem. On OS X,
however, it is not, and hence multiple res_query() calls from parallel
threads will compete and return bogus results.

The fix for this is to use res_nquery(), introduced in BIND 8.2, which
takes an explicit state argument. This allows us to manually store the
state thread-locally. If res_nquery() isn’t available, we fall back to
res_query(). It should be available on OS X though. As a data point,
it’s available on Fedora 27.

There’s a slight complication in the fact that OS X requires the state
to be freed using res_ndestroy() rather than res_nclose(). Linux uses
res_nclose().

(See, for example, the NetBSD man page:
https://www.unix.com/man-page/netbsd/3/res_ninit/. The Linux one is
incomplete and not so useful:
http://man7.org/linux/man-pages/man3/resolver.3.html.)

The new code will call res_ninit() once per res_nquery() task. This is
not optimal, but no worse than before — since res_query() was being
called in a worker thread, on Linux, it would implicitly initialise the
thread-local struct __res_state when it was called. We’ve essentially
just made that explicit. In practical terms, this means a
stat("/etc/resolv.conf") call per res_nquery() task.

In future, we could improve this by using an explicit thread pool with
some manually-created worker threads, each of which initialises a struct
__res_state on spawning, and only updates it on receiving
the #GResolver::reload signal.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=792050
2018-02-02 18:05:27 +01:00
Xavier Claessens
62c4768423 Meson: Add missing options and conform to naming guidelines
https://bugzilla.gnome.org/show_bug.cgi?id=790837
2017-12-19 14:56:11 -05:00
Jan Alexander Steffens (heftig)
69b2b5f262 meson: Fix libmount support
The define was still missing.

https://bugzilla.gnome.org/show_bug.cgi?id=789681
2017-10-31 15:24:04 +00:00
Julien Isorce
ea725a6414 gio: add g_socket_join_multicast_group_ssm (IGMPv3 SSM)
It adds support for source-specific multicast IGMPv3.

Allow receiving data only from a specified source when joining
a multicast group.

g_socket_join_multicast_group_ssm can be called multiple times
to allow receiving data from more than one source.

Support IPv4 and IPv6.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740791
2017-10-16 11:14:57 +01:00
Emmanuele Bassi
f40154e218 build: Look for mkostemp when configuring
We use this function, but it may be missing on older Linux platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=788705
2017-10-09 12:45:59 +01:00
Chun-wei Fan
54aee1f627 Meson: Set _WIN32_WINNT to 0x0601 (Windows 7)
We want to set _WIN32_WINNT so that functions will be properly found in
the headers, to target the NT6.1+ (Windows 7+) APIs.

Also improve the checks for if_nametoindex() and if_indextoname() on
Windows as they are supported in Windows Vista+, but they have
to be checked by linking against iphlpapi.lib (or -liphlpapi).  On other
platforms, they are still checked as they were before.

https://bugzilla.gnome.org/show_bug.cgi?id=783270
2017-08-17 23:40:35 +08:00
Tim-Philipp Müller
2ac8079b94 meson: fix unit tests and "Invalid byte sequence in conversion input"
Check if strerror_r returns a char * and define STRERROR_R_CHAR_P
if so, which is needed by g_strerror() since c8e268b

https://bugzilla.gnome.org/show_bug.cgi?id=784000
2017-07-19 10:34:45 +01:00
Thibault Saunier
0689231bd6 meson: Fix the build defining HAVE_RTLD_X
Otherwise RTLD_XXX get redefined.

https://bugzilla.gnome.org/show_bug.cgi?id=784133
2017-07-13 19:03:39 -04:00
Thibault Saunier
1d30c9eebc meson: Defining MAJOR_IN_ as done by AC_HEADER_MAJOR
https://bugzilla.gnome.org/show_bug.cgi?id=784133
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
fe2a9887a8 meson: Improve MSVC and MinGW support and fix dependencies everywhere
Disable gio tests on Windows, fix .gitignore to not ignore
config.h.meson, and add more things to it.

Rename the library file naming and versioning to match what Autotools
outputs, e.g., libglib-2.0.so.0.5000.2 on Linux, libglib-2.0-0.dll  and
glib-2.0-0.dll on Windows with MSVC.

Several more tiny fixes, more executables built and installed, install
pkg-config and m4 files, fix building of gobject tests.

Changes to gdbus-codegen to support out-of-tree builds without
environment variables set (which you can't in Meson). We now add the
build directory to the Python module search path.
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
213957970e meson: Fix glib, add gobject, gio, gthread, gmodule, etc
Several small fixes to the build files.

Lots of tests have also been added, and glib tests pass now.
2017-07-13 19:03:39 -04:00