Commit Graph

20166 Commits

Author SHA1 Message Date
Philip Withnall
63823ae628 gthreadedsocketservice: Abstract out a free function
This introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-12 15:21:33 +01:00
Philip Withnall
ec569ff2e2 gthreadedsocketservice: Tidy up property declarations
This introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-12 15:18:48 +01:00
Nirbheek Chauhan
61c4531b45 Merge branch 'autodetect-iconv-impl' into 'master'
meson: Add autodetection to the iconv combo option

Closes #1557

See merge request GNOME/glib!759
2019-04-12 06:02:45 +00:00
Nirbheek Chauhan
17823fa820 ci: The iconv combo option values have changed 2019-04-12 11:12:28 +05:30
Nirbheek Chauhan
ace32cd8e2 gconvert: Don't differentiate between GNU iconv and macOS iconv
Both provide iconv_open, and in fact, we weren't using the difference
anywhere in glib at all.
2019-04-12 11:12:28 +05:30
Nirbheek Chauhan
2f066aeb51 meson: Add autodetection to the iconv combo option
Instead of requiring the user to specify which option to use, which
they will not really know, nor should they need to know.

Search for each type of iconv (in the C library, as a separate
native library, as the GNU implementation) by default.

Fixes https://gitlab.gnome.org/GNOME/glib/issues/1557
2019-04-12 11:12:28 +05:30
Philip Withnall
eefe435828 Merge branch 'wip/nielsdg/gdbus-colorized-output' into 'master'
RFC: gdbus-tool: Add --color option for introspect

See merge request GNOME/glib!761
2019-04-11 22:39:53 +00:00
Philip Withnall
7c584260fc Merge branch 'gnulib.msvc.fixes' into 'master'
Fix gnulib build on older Visual Studio builds

See merge request GNOME/glib!757
2019-04-11 16:51:14 +00:00
Philip Withnall
65b6aac4c2 Merge branch 'linux-argv0' into 'master'
tests: Check that option-argv0 test succeeds on Linux

See merge request GNOME/glib!772
2019-04-11 16:46:17 +00:00
Niels De Graef
6287f64e1d gdbus-tool: Colorize the output of "introspect"
When available on stdout, the `gdbus introspect` command will now add
colors to make it easier for humans to visually parse the output.

https://gitlab.gnome.org/GNOME/glib/merge_requests/761
2019-04-11 18:03:50 +02:00
Sebastian Dröge
6b8c9c79e1 Merge branch 'gslice-use-G_APPROX_VALUE-macro' into 'master'
gslice: Use a convenience macro

See merge request GNOME/glib!765
2019-04-09 08:57:09 +00:00
Chun-wei Fan
de5761db48 glib/gnulib: Include gnulib_math.h in place of math.h
For the new gnulib modules that were added, include gnulib_math.h in
place of math.h, so that the replacement functions can be properly
referenced.
2019-04-08 17:51:00 +08:00
Chun-wei Fan
35de287690 Update glib/gnulib/README
List the added gnulib modules that need to be updated.
2019-04-08 17:51:00 +08:00
Chun-wei Fan
b532b9cecf build: Check for more math.h functions in gnulib
There are now C99 functions that the printf items want to use that may
not be necessarily supported by the math.h that is shipped by the
compiler, such as signbit(), isinf(), isnan() and isfinite() and their
double, long and float counterparts.

This checks for whether these functions are provided by the math.h
shipped by the compiler, and builds the gnulib implementations of them
if they cannot be found.  Currently no attempt is made to check whether
these, if available from the compiler's math.h, are compliant with the
specs.
2019-04-08 17:50:59 +08:00
Chun-wei Fan
a1fbeb3e4f build: Improve tests for frexpl() and ldexpl()
The test programs for those in the Meson build files will not work for
Visual Studio prior to 2013 (whereas the rest of the code does).
Improve the tests for these by:

-Adding a test to see whether we can re-define a prototype for these
 functions, using cc.compiles().  If so, set HAVE_DECL_xxxx to be 0,
 otherwise set HAVE_DECL_xxxx to be 1.

Also, for glib/gnulib/frexpl.c, don't undefine frexpl on Visual Studio,
otherwise we will not be able to compile/link it on Visual Studio
compilers.
2019-04-08 17:50:59 +08:00
Emmanuele Bassi
2ed56ccc0c Merge branch 'wip/ebassi/test-report' into 'master'
ci: Generate a cover report for the test suite

See merge request GNOME/glib!769
2019-04-08 09:43:04 +00:00
Chun-wei Fan
3e54a34e33 CI: Run test coverage for Visual Studio builds
Ensure that we do run it and upload the results.
2019-04-08 16:51:47 +08:00
Chun-wei Fan
b1e6e7fb18 .gitlab-ci/test-msvc.bat: Generate cover report for tests
...for Visual Studio builds in the CI.
2019-04-08 14:06:22 +08:00
Руслан Ижбулатов
7a399e859d Fix the "/proc/self/cmdline" test
Add a missing ifdef from gfileutils.c that is needed for O_BINARY.

The other option was to remove O_BINARY, but i left it there for
the sake of completeness, as this is what g_file_get_contents() uses.
2019-04-07 18:41:39 +00:00
Tomasz Miąsko
7db35ec7a8 tests: Check that option-argv0 test succeeds on Linux
To avoid potential regression in feature check that configures
`HAVE_PROC_SELF_CMDLINE` treat test failures on Linux as fatal.

This restores behaviour from before 4c038a27ff.
2019-04-07 00:00:00 +00:00
Emmanuele Bassi
95b7a8ab10 ci: Run test coverage for MSYS2 job 2019-04-06 15:31:41 +01:00
Emmanuele Bassi
ed65996300 ci: Generate a cover report for the test suite
GitLab can show the results of a CI pipeline if the pipeline generates a
report using the JUnit XML format.

Since Meson provides a machine parseable output for `meson test`, we can
take that and turn it into XML soup.
2019-04-06 14:19:20 +01:00
Peter Bloomfield
45a3598aa2 gslice: Use a convenience macro
In magazine_cache_trim(), use the recent G_APPROX_VALUE macro to decide
when to trim the magazine chain.

See <URL:fad04d2e18 (note_471824)>.
2019-04-03 12:46:20 -04:00
Philip Withnall
9d43bfc4ed Merge branch 'cygwin-visibility' into 'master'
Use W32 visibility for Cygwin

See merge request GNOME/glib!752
2019-04-03 16:03:16 +00:00
LRN
430d584046 Merge branch 'cygwin-proc-self-cmdline' into 'master'
Check for /proc/self/cmdline

See merge request GNOME/glib!754
2019-04-03 15:38:06 +00:00
Руслан Ижбулатов
4c038a27ff Check for /proc/self/cmdline
Instead of hardcoding /proc/self/cmdline use for __linux__ only,
do a configure-time test for it.

Specifically, this enables /proc/self/cmdline use on Cygwin.

The configure-time test is very primitive (just tests that the
file exists and that it's possible to read more than one byte from it),
relying on the testsuite for more extensive checks.

The test in the testsuite is modified to always run, even on platforms
where it isn't supposed to pass. If it fails there, the testing framework
skips it. If the test unexpectedly passes, that is reported too.
2019-04-03 15:17:34 +00:00
Emmanuele Bassi
cf54fc3600 Merge branch '1737-gdbus-tool-wait' into 'master'
gdbus-tool: Fix units for `gdbus-tool wait` timeout

Closes #1737

See merge request GNOME/glib!753
2019-04-03 12:36:54 +00:00
Philip Withnall
80988146df Merge branch 'g_get_prgname-annotations' into 'master'
gutils: Add (nullable) annotation to g_get_prgname()

See merge request GNOME/glib!762
2019-04-03 12:32:42 +00:00
Philip Withnall
abde3efb34 Merge branch 'wip/oholy/trash-autofs' into 'master'
gunixmounts: Return the last matching mount for same mount path

Closes #1727

See merge request GNOME/glib!740
2019-04-03 12:23:10 +00:00
Philip Withnall
8349ceeac9 Merge branch 'use_after_free' into 'master'
Fix use-after-free triggered by gnome-session-binary

See merge request GNOME/glib!741
2019-04-03 12:01:04 +00:00
Philip Withnall
c1c26448b1 gutils: Add (nullable) annotation to g_get_prgname()
It can return NULL if no program name has been set yet (i.e.
g_set_prgname() has not been called from somewhere).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-03 12:31:44 +01:00
Philip Withnall
9976418262 Merge branch 'fix-cocoa-backend-loading' into 'master'
Properly ensure the cocoa notification backend type

See merge request GNOME/glib!760
2019-04-01 09:34:44 +00:00
Ignacio Casal Quinteiro
55870d4b42 Properly ensure the cocoa notification backend type 2019-03-29 15:52:38 +01:00
Philip Withnall
d86146df38 gdbus-tool: Fix units for gdbus-tool wait timeout
They were documented as being in seconds, but implemented as
milliseconds.

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

Fixes: #1737
2019-03-27 17:04:58 +00:00
Philip Withnall
ad614fc070 Merge branch 'cygwin-rtld_next' into 'master'
Check for RTLD_NEXT

See merge request GNOME/glib!750
2019-03-27 16:25:48 +00:00
Руслан Ижбулатов
a53ff7460e Check for RTLD_NEXT
Check for RTLD_NEXT being present, and disable the gsocketclient-slow
test if it's absent, since the shlib dependency of that test requires
RTLD_NEXT to function.

This allows the testsuite to be built on Cygwin, which behaves
exactly like UNIX, but doesn't have RTLD_NEXT.
2019-03-27 16:10:17 +00:00
Philip Withnall
d264001d79 Merge branch 'cygwin-macro' into 'master'
Set G_WITH_CYGWIN again

See merge request GNOME/glib!736
2019-03-26 22:55:56 +00:00
Philip Withnall
ad19bb8f12 Merge branch '1258-input-stream-annotations' into 'master'
ginputstream: Add missing (out) annotations to read() functions

Closes #1258

See merge request GNOME/glib!738
2019-03-26 22:53:27 +00:00
Philip Withnall
f84d10746e Merge branch 'wip/jtojnar/gsettings-cleanup' into 'master'
gio: Add missing autocleanup definition for GSettingsSchema{Key,Source}

See merge request GNOME/glib!749
2019-03-26 22:50:05 +00:00
Jan Tojnar
c940816181
gio: Add missing autocleanup definition for GSettingsSchemaKey 2019-03-26 16:40:28 +01:00
Jan Tojnar
edaae619e5
gio: Add missing autocleanup definition for GSettingsSchemaSource 2019-03-26 16:38:06 +01:00
Patrick Griffis
01d974194a Merge branch 'cocoa-notification-backend-default' into 'master'
gcocoanotificationbackend: give more priority than the gtk one

See merge request GNOME/glib!745
2019-03-26 14:30:45 +00:00
Ignacio Casal Quinteiro
1e1759d5a2 gcocoanotificationbackend: give more priority than the gtk one
On OSX both backends are built. Generally we want to use the cocoa
backend by default and in case it is not supported, i.e because
the application is not using a bundle then we should fallback
to the gtk one.
2019-03-26 10:20:25 +01:00
Stefan Sperling
052ad6098d Fix use-after-free triggered by gnome-session-binary
ostream_flush_cb() was calling flush_data_list_complete() with a single
element list with an item that had already been freed. This was observed
on OpenBSD where memory is overwritten with 0xdf during free():

    error=0x0) at ../glib-2.58.3/gio/gdbusprivate.c:1156
1156          g_mutex_lock (&f->mutex);
(gdb) p /x *f
$74 = {mutex = {p = 0xdfdfdfdfdfdfdfdf, i = {0xdfdfdfdf, 0xdfdfdfdf}},
  cond = { p = 0xdfdfdfdfdfdfdfdf, i = {0xdfdfdfdf, 0xdfdfdfdf}},
  number_to_wait_for = 0xdfdfdfdfdfdfdfdf, error = 0x0}

This happened because the thread freeing the element didn't properly wait
for the asynchronous flush operation to finish.
Gnome's developer docs say: "g_cond_wait() must always be used in a loop"
https://developer.gnome.org/glib/stable/glib-Threads.html#g-cond-wait
2019-03-25 07:44:13 +01:00
Руслан Ижбулатов
9ca7ac782e Set G_WITH_CYGWIN again
This macro was lost during meson migration. Set it again.

Also explain that Cygwin maintainers applied patches[0] to glib that
simply marked all G_PLATFORM_WIN32-protected code as !defined(G_WITH_CYGWIN),
i.e. they did not want that code to compile.
Instead of altering ifdef guards all over the place, we'll just
not define G_PLATFORM_WIN32 for Cygwin anymore.

[0]: 3a873fdd1b/2.36.3-not-win32.patch
2019-03-22 14:44:53 +00:00
Sebastian Dröge
ecad5cd522 Merge branch '1732-gai_strerror-locale' into 'master'
gresolver: Convert encoding of gai_strerror() return value

Closes #1732

See merge request GNOME/glib!739
2019-03-22 13:57:39 +00:00
Philip Withnall
89416debb0 gresolver: Convert encoding of gai_strerror() return value
It returns a string in the libc locale, which is not necessarily UTF-8.
Convert that to UTF-8 before returning it to the caller.

Spotted by Tomasz Miąsko.

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

Fixes: #1732
2019-03-22 13:32:14 +00:00
Philip Withnall
3a32c75876 ginputstream: Add missing (out) annotations to read() functions
This is a reversion of the reversion of commit
c192595268, after more discussion on the
issue.

Fixes: #1258
2019-03-22 13:20:41 +00:00
Ondrej Holy
bc52235efc gunixmounts: Return the last matching mount for same mount path
More mounts can have same mount path, but only the last one is
accessible. Thus we should always return the last matching mount from
g_unix_mount_at() and g_unix_mount_for(). This should also solve
problems with g_file_trash() on automounted filesystems, which are
caused by the recently added mount checks.

Closes: https://gitlab.gnome.org/GNOME/glib/issues/1727
2019-03-22 12:41:47 +01:00
Michael Catanzaro
abeac84105 Merge branch 'gai_strerror-thread-safety' into 'master'
gresolver: Don’t use gai_strerror() on Windows, as it isn’t threadsafe

See merge request GNOME/glib!737
2019-03-21 14:37:18 +00:00