Commit Graph

5654 Commits

Author SHA1 Message Date
Philip Withnall
af712bbce1 gdbusmessage: Validate type of message header signature field
Parsing a D-Bus message with the signature field in the message header
of type other than ‘g’ (GVariant type signature) would cause a critical
warning. Instead, we should return a runtime error.

Includes a test.

oss-fuzz#9825

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-10-23 17:01:51 +13:00
Philip Withnall
da512adc34 Merge branch 'stap-pass-cflags' into 'master'
build-sys: Pass CFLAGS to $(DTRACE)

See merge request GNOME/glib!403
2018-10-22 22:39:59 +00:00
Nirbheek Chauhan
8b3590c231 meson: Add macOS libtool versioning for ABI compatibility
With this, the compatibility version and current version values in macOS
and iOS dylibs will match the values set by Autotools.

See: https://github.com/mesonbuild/meson/issues/1451
2018-10-22 06:51:32 +05:30
Xavier Claessens
a46f88ba1b Meson: Fix linking of gdbus-peer test 2018-10-19 10:08:00 -04:00
Michael Catanzaro
4e94164a72 Fix a couple typos in doc comments 2018-10-17 13:23:36 -05:00
Ondrej Holy
ce9fa7a172 glocalfile: Fix bug uri in trash test
Fix typo in g_test_bug_base and move g_test_bug in the concrete test.
2018-10-17 12:42:04 +02:00
Ondrej Holy
0f5017fb70 glocalfile: Fix access::can-trash if parent is symlink
G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH can be set to a wrong value if
its parent dir is a symlink. This is because the find_mountpoint_for()
function tries to find mountpoint for a filepath and expands symlinks
only in parent dirs. But in this case the path is already parent dir
and needs to be expanded first...

Closes: https://gitlab.gnome.org/GNOME/glib/issues/1522
2018-10-17 12:42:04 +02:00
Colin Walters
d7233ef81e build-sys: Pass CFLAGS to $(DTRACE)
Fedora is using https://fedoraproject.org/wiki/Changes/Annobin
to try to ensure that all objects are built with hardening flags.
Pass down `CFLAGS` to ensure the SystemTap objects use them.
2018-10-15 21:50:31 +00:00
Philip Withnall
efda2be302 Merge branch 'ghash-hpj-2018' into 'master'
GHashTable improvements

See merge request GNOME/glib!208
2018-10-10 23:01:51 +00:00
Philip Withnall
2eaeefdf5d gdbusproxy: Document blocking guarantees of constructors
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/734
2018-10-09 09:15:43 +13:00
Christoph Reiter
180e59539c build: work around meson issue with too long filenames on Windows. Fixes #1556
When using glib as a meson subproject on Windows the build currently fails
due to too long paths during the build process. See
https://github.com/mesonbuild/meson/issues/4226 for the upstream bug.

To work around the issue shorten the filenames of the generated gdbus files.
2018-10-04 10:45:45 +02:00
Hans Petter Jansson
0600dd3220 tests: Fix bad node ordering assumption
The tests were making assumptions about the order of the returned D-Bus
introspection nodes. However, these are semantically unordered and
changes to e.g. GHashTable would break the tests.

Fix this by applying a sort prior to validation.
2018-10-03 22:14:38 +02:00
Philip Withnall
5002d87dec Merge branch '1525-task-result' into 'master'
gtask: Check an error hasn’t been returned when calling g_task_return*()

Closes #1525

See merge request GNOME/glib!368
2018-10-02 10:07:49 +00:00
Philip Withnall
290bb0dd1b gtask: Compress GTask struct using a bitfield
There are a lot of gbooleans in the private GTask struct, which seems a
bit wasteful. Use a bitfield to compress the struct a bit.

This reduces the size of the struct from 216 bytes to 168 bytes on my
64-bit machine.

One of the fields needs to remain separate, since it’s used from a
TRACE() macro which calls typeof() on it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-10-02 09:59:13 +01:00
Philip Withnall
f0cecba199 tests: Add return ordering tests for GTask
These are based on an example test program provided by Will Thompson in
issue #1525.

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

https://gitlab.gnome.org/GNOME/glib/issues/1525
2018-10-02 09:59:13 +01:00
Philip Withnall
bea3770935 gtask: Check an error hasn’t been returned when calling g_task_return*()
These functions already check to see if a successful result has already
been returned; expand them to also check to see if an error has been
returned.

We can’t just check GTask.result_set, as that’s actually an indicator
for whether the GTask.result member is filled — when
g_task_propagate_*() is called, it’s cleared again. We need a new state
bit.

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

https://gitlab.gnome.org/GNOME/glib/issues/1525
2018-10-01 21:45:48 +01:00
Philip Withnall
03232bd6a6 tests: Fix location of an unref in the GTask tests
This method drops the last reference *it* owns to the GTask, but then
continues to call methods on the GTask. This wasn’t resulting in
failures because a ref in another thread kept the GTask alive, but
that’s quite dodgy.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-10-01 21:45:48 +01:00
Philip Withnall
846a61457a Merge branch 'wjt/g_desktop_app_info_get_string_list' into 'master'
Add g_desktop_app_info_get_string_list(); fix g_key_file_free()

See merge request GNOME/glib!339
2018-10-01 19:21:05 +00:00
Will Thompson
5ca9eca632 gdesktopappinfo: add get_string_list() function
The X-Flatpak-RenamedFrom key is used in .desktop files to identify past
names for the desktop file. It is defined to be a list of strings.
However, there was previously no correct way to retrieve a list of
strings from the GKeyFile wrapped by GDesktopAppInfo, short of
re-parsing the file with GKeyFile.

Note that doing something like:

    g_strsplit (g_desktop_app_info_get_string (...), ";", -1)

is not correct: the raw value "a\;b;" represents the one-element list
["a;b"], but g_key_file_get_string() rejects the sequence "\;", and so
g_desktop_app_info_get_string() returns NULL in this case. (Of course, a
.desktop file with a semicolon in its name is a pathological case.)

Add g_desktop_app_info_get_string_list(), a trivial wrapper around
g_key_file_get_string_list(), similar to g_desktop_app_info_get_string()
and co.

The change from g_key_file_free() to g_key_file_unref() in the test is
needed because g_key_file_free() clears the contents of the keyfile.
This is fine for all the fields which are eagerly loaded and copied into
GDesktopAppInfo, but not when we want to access arbitrary stuff from the
keyfile.
2018-10-01 20:03:55 +01:00
Xavier Claessens
6e0a03ee07 Merge branch '1536-link-whole' into 'master'
Meson: Fix static linking of convenience libraries

Closes #1536

See merge request GNOME/glib!357
2018-09-28 14:54:40 +00:00
Simon McVittie
62af03bda8 Meson: Extract objects from convenience libraries to link them
This avoids the convenience library being treated as though it was
an installed static library (objects not included in the dependent
static library, and convenience library being listed in the pkg-config
metadata), both of which would make static linking impossible.
This is a workaround for meson not having
https://github.com/mesonbuild/meson/pull/3939 merged yet.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1536
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-28 15:15:48 +01:00
Xavier Claessens
24d7a73b93 Meson: Bump dependency to 0.48.0 2018-09-27 16:01:41 -04:00
Xavier Claessens
27b5fb5892 Meson: appinfo tests are racy if run in parallel 2018-09-25 15:14:53 -04:00
Xavier Claessens
88a1188fc1 Merge branch 'speling' into 'master'
Fix spelling mistakes detected by Debian's Lintian tool

See merge request GNOME/glib!354
2018-09-25 18:16:52 +00:00
Simon McVittie
03cf374848 Spelling: Fix spelling of "unknown"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 14:35:13 +01:00
Simon McVittie
e0a8df12ef Spelling: Fix spelling of "similarly"
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 14:35:13 +01:00
Simon McVittie
cbc7fbbf7d meson: Run build-time tests with --tap where supported
This makes it easier to debug test failures, by ensuring that g_debug()
and g_test_message() are printed as TAP diagnostics.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1528
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-24 23:37:12 +01:00
Xavier Claessens
b512135fc6 Merge branch '1535-tap' into 'master'
Meson: Run in TAP mode installed tests that support it

Closes #1535

See merge request GNOME/glib!343
2018-09-24 14:49:40 +00:00
Xavier Claessens
8391219e4c Meson: Run in TAP mode installed tests that support it 2018-09-23 13:44:15 -04:00
Simon McVittie
fa32ee6481 Remove unnecessary +x permissions
None of these files starts with a #! line, and they are not native
binary executables, so if a user attempts to execute them as a program,
Unix shells will run them as /bin/sh scripts. This is not going to end
well, since none of them are shell scripts (the gio bash completion
is for bash, which is not a lowest-common-denominator POSIX shell, and
in any case is designed to be sourced rather than executed).

Fixes: #1539
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-23 17:01:04 +01:00
Emmanuele Bassi
032f1a9782 Merge branch 'gio-fix-build' into 'master'
gio: automake: Add libgmodule dependency

See merge request GNOME/glib!334
2018-09-22 15:49:07 +00:00
Xavier Claessens
96fafcfe92 Meson: Fix missing files when installing tests
Closes #1527
2018-09-21 08:45:02 -04:00
Philip Withnall
18456b74a6 tests: Mark two more tests as slow
These keep on taking just longer than 30s on my local machine when run
in parallel with the rest of the tests (i.e. with `ninja test`). Testing
them individually, they do terminate correctly.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-09-20 17:51:18 +01:00
Bernhard Walle
0d97c4d20c gio: automake: Add libgmodule dependency
Otherwise I get following compile error:

 libtool: link: /home/builduser/toolchains/linux/tc/2017-12/x86-ncp-linux-gnu/bin/i686-ncp-linux-gnu-gcc -Wall -Wstrict-prototypes -Wmisleading-indentation -Wno-bad-function-cast -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format=2 -O2 -Wall -pipe -Wformat -g -fstack-protector-strong -fPIC -fno-strict-aliasing -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-rpath-link=/home/builduser/workspaces/rws_trunk_linux_x86_build_shared-fips/build/3p/linux/x86/install/zlib/lib -Wl,-rpath-link=/home/builduser/workspaces/rws_trunk_linux_x86_build_shared-fips/build/3p/linux/x86/install/libffi/lib -o .libs/gio gio-tool.o gio-tool-cat.o gio-tool-copy.o gio-tool-info.o gio-tool-list.o gio-tool-mime.o gio-tool-mkdir.o gio-tool-monitor.o gio-tool-mount.o gio-tool-move.o gio-tool-open.o gio-tool-rename.o gio-tool-remove.o gio-tool-save.o gio-tool-set.o gio-tool-trash.o gio-tool-tree.o  -L/home/builduser/workspaces/rws_trunk_linux_x86_build_shared-fips/build/3p/linux/x86/install/zlib/lib -L/home/builduser/workspaces/rws_trunk_linux_x86_build_shared-fips/build/3p/linux/x86/install/libffi/lib ./.libs/libgio-2.0.so ../gobject/.libs/libgobject-2.0.so ../glib/.libs/libglib-2.0.so -Wl,-rpath -Wl,/home/builduser/workspaces/rws_trunk_linux_x86_build_shared-fips/build/3p/linux/x86/install/glib/lib
 /home/builduser/toolchains/linux/tc/2017-12/x86-ncp-linux-gnu/bin/../lib/gcc/i686-ncp-linux-gnu/6.3.0/../../../../i686-ncp-linux-gnu/bin/ld: warning: libgmodule-2.0.so.0, needed by ./.libs/libgio-2.0.so, not found (try using -rpath or -rpath-link)
 ./.libs/libgio-2.0.so: undefined reference to `g_module_error'
 ./.libs/libgio-2.0.so: undefined reference to `g_module_close'
 ./.libs/libgio-2.0.so: undefined reference to `g_module_open'
 ./.libs/libgio-2.0.so: undefined reference to `g_module_supported'
 ./.libs/libgio-2.0.so: undefined reference to `g_module_symbol'
 collect2: error: ld returned 1 exit status
 Makefile:2300: recipe for target 'gio' failed

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
2018-09-18 10:27:19 +02:00
Philip Withnall
f928dfdf57 Merge branch 'master' into 'master'
Issue #1513: fix g_icon_to_string() regression (doc inconsistency).

Closes #1513

See merge request GNOME/glib!305
2018-09-17 10:32:32 +00:00
Iain Lane
d2a1a4bf55 Merge branch '1523-network-monitor-init-failure' into 'master'
gnetworkmonitornm: Set a GError properly on an error handling path

See merge request GNOME/glib!322
2018-09-13 14:27:56 +00:00
Jehan
8519368c0e Fix g_icon_to_string() regression (doc inconsistency).
g_icon_new_for_string() docs states that it should return a single name
when created with a single name. I add a second condition to this case:
the themed icon must not include default fallbacks (i.e. it must not
have been created with `g_themed_icon_new_with_default_fallbacks()`).
Otherwise the return value of `g_icon_new_for_string()` would not
recreate the same icon list when passed to `g_icon_new_for_string()`
(which would be another documentation inconsistency).

g_icon_new_for_string() is now back to old behavior for this specific
case.

I also revert the unit test for this case, and add a new unit test when
using g_themed_icon_new_with_default_fallbacks() with a single name as
well.

Closes #1513.
2018-09-13 13:16:40 +02:00
Iain Lane
6eb5bd8192
network-monitor-race test: Have the subprocess inherit stdout and stderr
If initialising the monitors produces any debug output, it is good to be
able to see it when running this test.
2018-09-13 11:44:16 +01:00
Iain Lane
36c79adb2f
gnetworkmonitornetlink: Pass a GError into read_netlink_messages()
Currently this function calls `g_warning()` explicitly. It would be
nicer to properly propagate these failure up to the caller that tried to
initialise us.
2018-09-13 11:44:16 +01:00
Iain Lane
6629423e7a
gnetworkmonitornetlink: Close the socket after disconnecting its GSources
`read_netlink_messages()` is the callback attached to the netlink socket
(G_IO_IN). It calls `g_socket_receive_message()`. There is a race
condition that if the socket is closed while there is a pending call, we
will try to receive on a closed socket, which fails.

To avoid this, we switch the order of the operations around: first
destroy the source and then close the socket.
2018-09-13 11:14:34 +01:00
Iain Lane
7fe8aa68a2
gnetworkmonitornetlink: Don't check if a passed-in GError ** is NULL
This is not a correct way to check if `g_socket_new_from_fd()` failed.
Instead just see if it returned `NULL` itself.

This was preventing the netlink monitor from being initialised.

Closes #1518
2018-09-13 11:14:34 +01:00
Philip Withnall
c5761146bc gnetworkmonitornm: Set a GError properly on an error handling path
All the other initialisation failure paths set a GError, but this one
didn’t. Set a GError to avoid breaking the invariant that returning
FALSE should always have a GError set.

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

https://gitlab.gnome.org/GNOME/glib/issues/1523
2018-09-13 10:25:05 +01:00
Michael Catanzaro
5bc35a7245 Merge branch 'mcatanzaro/auto-start-portals' into 'master'
Autostart xdg-desktop-portal if needed

See merge request GNOME/glib!317
2018-09-13 04:43:59 +00:00
Philip Withnall
dbe0572d57 Merge branch 'w32-gio-tests-enable' into 'master'
Enable GIO tests on Windows

See merge request GNOME/glib!312
2018-09-12 22:42:16 +00:00
Philip Withnall
3f10c8b059 Merge branch 'gdbus-codegen-type-punned-pointer-warnings' into 'master'
codegen: Change pointer casting to remove type-punning warnings

See merge request GNOME/glib!309
2018-09-12 22:31:54 +00:00
Michael Catanzaro
04989cfafb Autostart xdg-desktop-portal if needed
This is a speculative fix for epiphany#533, which we think might be
caused by xdg-desktop-portal not ever being started. This service is
started on-demand, not automatically.
2018-09-12 15:38:44 -05:00
Michael Catanzaro
0e0b94d635 gdbus: Improve error when well-known name is unowned
We should indicate the name, so that we have some chance of debugging
this problem.
2018-09-12 11:32:55 -05:00
Руслан Ижбулатов
ad3694b82a Enable GIO tests on Windows
1) Remove the non-Windows-only condition for subdir('tests').
2) Add libiphlpapi, libws2_32 and libsecur32 deps, needed for W32 tests.
3) Remove the -no-undefined argument (gcc doesn't understand it,
   it *does* understand -Wl,-no-undefined; either way, the test
   compiles without this argument just fine; maybe meson adds it
   by itself - you can hardly build shared modules without it).
4) Add or fix a number of includes
5) Disable gdbus-objectmanager tests when building with MSVC
   (right now these tests don't work on Windows anyway, so the fact
    that MSVC can't even build them properly is irrelevant;
    most likely gdbus-codegen needs changes to put _GLIB_EXTERN
    before each function)
2018-09-12 15:42:11 +00:00
Руслан Ижбулатов
157dfc8aae test_internal_enhanced_stdio: don't use g_assert()
g_assert() can be disabled, use more specific assertion macros.
2018-09-12 14:35:20 +00:00
Руслан Ижбулатов
c24d3b0fc3 W32: extend the g-file-info test with new DOS attributes 2018-09-12 14:35:18 +00:00
Руслан Ижбулатов
c6b4eff09e W32: new GFileInfo attributes
G_FILE_ATTRIBUTE_DOS_IS_MOUNTPOINT allows mountpoints
(NTFS reparse points with IO_REPARSE_TAG_MOUNT_POINT tag) to
be told apart from symlinks (NTFS reparse points with
IO_REPARSE_TAG_SYMLINK tag), even though both are reported
by glib as "symlinks".

G_FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG allows the exact
reparse tag value to be obtained by the user. This way
even more exotic reparse points can be identified and
handled by the user (glib itself currently has no code
to work with any reparse points that are not symlinks
or mountpoints).
2018-09-12 14:35:16 +00:00
Philip Withnall
83cd2f6204 gvolumemonitor: Document the need to run a main loop
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1119
2018-09-07 12:18:44 +01:00
Robert Ancell
64b76c7ca5 codegen: Change pointer casting to remove type-punning warnings
The existing code was generating code with undefined results that modern compilers warn about:

accounts-generated.c:204:23: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     (GDBusArgInfo **) &_accounts_accounts_method_info_list_cached_users_OUT_ARG_pointers,
2018-09-07 10:19:05 +12:00
Emmanuele Bassi
86ab6ffa8d Merge branch '303-list-store-tests' into 'master'
Add more GListStore/GListModel tests

See merge request GNOME/glib!304
2018-09-05 11:11:58 +00:00
Philip Withnall
574e2c8a99 Merge branch 'wip/otte/simplify-liststore-splice' into 'master'
liststore: Simplify code

See merge request GNOME/glib!303
2018-09-05 10:38:59 +00:00
Philip Withnall
53a6689ebf tests: Test g_list_model_get_object()
It wasn’t being tested. It should behave the same as
g_list_model_get_item(), so write a wrapper for the two.

This brings the code coverage of glistmodel.c up to 100%.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-09-05 11:36:13 +01:00
Philip Withnall
7e33c50dd3 tests: Add more GListStore tests to get it too 100% coverage
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-09-05 11:27:06 +01:00
Philip Withnall
35d1ef678a gliststore: Simplify a GType check on construction
When setting the GListStore:item-type property we need to check the
GType is a GObject (or subclass). There was some explicit code for this,
but when actually testing it and looking at the code coverage, it turns
out that the GObject property type check coming from
g_param_spec_gtype() does everything we want, and the custom
g_critical() can never be hit. So turn it into an assertion.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-09-05 11:25:58 +01:00
Philip Withnall
98f326a020 Merge branch 'wip/otte/fallthrough' into 'master'
Add G_GNUC_FALLTHROUGH for __attribute__(fallthrough))

See merge request GNOME/glib!296
2018-09-04 22:06:26 +00:00
Benjamin Otte
e1cec0fb11 liststore: Simplify code
This is also faster, though I doubt anyone's able to measure it.

The previous code was a more complicted way to do the same thing and it
was likely written the more complicated way because it fell out commit
758d7073a9 when fixing
https://bugzilla.gnome.org/show_bug.cgi?id=795307
2018-09-04 20:31:51 +02:00
Benjamin Otte
3aff811d13 Use G_GNUC_FALLTHROUGH where appropriate 2018-09-04 20:24:25 +02:00
Christoph Reiter
912581340e Remove all static ChangeLog files
They only contain old information which is also available in git
2018-09-04 15:56:54 +02:00
Ondrej Holy
6ae061b74d Merge branch 'add-identifier-class-loop' into 'master'
Document new volume class `loop`

See merge request GNOME/glib!293
2018-09-04 08:29:01 +00:00
Philip Withnall
d3656705fa Merge branch 'default-tls-database' into 'master'
gtlsbackend: add support for setting the default TLS database

Closes glib-networking#35

See merge request GNOME/glib!273
2018-09-03 13:22:39 +00:00
Philip Withnall
8f157d0274 Merge branch 'wip/fmuellner/nm-portal-changed-signal' into 'master'
portal network monitor: Always emit changed signal on changed

See merge request GNOME/glib!294
2018-09-03 12:14:18 +00:00
Matthew Waters
27fca3474c gtlsdatabase: document that implementations must be thread-safe 2018-09-03 13:55:57 +10:00
Matthew Waters
b84951eb6f gtlsbackend: add support for setting the default TLS database
There are many cases where a default TLS database is not able to be
defined within the constraints of a system.  For example glib-networking
(or glib-openssl) cannot retrieve the default certificate store on iOS
or Android and need to be initialized from a cert file of certificates
bundled with the application.

Previously GStreamer was relying on a custom patch to glib-networking to
populate the default database from the file pointed to by the
CA_CERTIFICATES environment variable however the mechanism that enabled
this was recently remove from glib-networking.

Adding a more generic g_tls_backend_set_default_database() API allows
application developers to override the default database using their own
certificates as well as allowing equivalent functionality on Android/iOS
(or others) as on the default database handling Linux.

Fixes https://gitlab.gnome.org/GNOME/glib-networking/issues/35
2018-09-03 13:55:57 +10:00
Florian Müllner
423a2936ea portal network monitor: Always emit changed signal on changed
The ::network-changed signal is documented to indicate any change in
network configuration, which doesn't necessarily imply a property
change - additional services becoming available after connecting to
a VPN comes to mind for instance.

In order to match the "native" network monitor's behavior, always
emit the signal when it's in response to the 'changed' D-Bus signal.

Also emit the signal unconditionally when loading the initial property
values, to allow clients to differentiate between "offline" meaning
"offline" and "offline" meaning "uninitialized".
2018-09-01 19:31:45 +02:00
segfault
c341479c23 Document new loop class 2018-08-31 22:02:02 +02:00
Ryan Schmidt
612c450bd4 gio: Don't redefine GKqueueFileMonitor
Fixes build on old compilers that don't allow type redefinitions.

Closes: https://gitlab.gnome.org/GNOME/glib/issues/1506
2018-08-31 09:52:29 -05:00
Philip Withnall
b1cae79f78 glib-compile-resources: Fix generated code compiling with C++ compilers
With 0d685b4946, we now encode resource
data as a string. Strings have trailing nul terminators. A C compiler
will happily ignore the fact that the nul terminator exceeds the stated
array length, and will drop it — but a C++ compiler won’t, and will
raise:

error: initializer-string for array of chars is too long [-fpermissive]

Fix that by increasing the array length by 1, and subtracting it again
in the GStaticResource struct.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-31 12:29:39 +01:00
Philip Withnall
7427bb7184 Merge branch 'wip/oholy/nfs-poll-monitor' into 'master'
glocalfilemonitor: Fallback to poll file monitor for NFS

See merge request GNOME/glib!219
2018-08-31 10:51:25 +00:00
Philip Withnall
9be6122e11 Merge branch 'gresource-string-encoding' into 'master'
glib-compile-resources: encode data as string

See merge request GNOME/glib!264
2018-08-31 10:46:24 +00:00
Philip Withnall
f696f512a5 Merge branch 'mcatanzaro/inappropriate-fallback-error' into 'master'
Add a new GTlsError to indicate protocol downgrade attacks

See merge request GNOME/glib!200
2018-08-31 10:44:30 +00:00
Philip Withnall
d9b331f4d4 Revert "Add a gnet utility"
This reverts commit 3c1902fcf9.

This was accidentally re-added from an old version of the branch before
!265 was merged. It should not have been re-added.
2018-08-28 11:59:04 +01:00
Philip Withnall
f65e8eb7e3 Merge branch 'subprocess-cancellable-callback-fix' into 'master'
subprocess: Fix communicate_cancelled signature

See merge request GNOME/glib!266
2018-08-28 10:32:07 +00:00
Matthias Clasen
917dee45b2 Merge branch 'network-monitor-again' into 'master'
Network monitor again

See merge request GNOME/glib!265
2018-08-27 15:32:51 +00:00
Marco Trevisan (Treviño)
72bf795db5 tests, subprocess: units for cancelled communications 2018-08-27 17:08:47 +02:00
Florian Müllner
d047ca341b portal network monitor: Validate connectivity
Only accept connectivity values that are actually
in the range of GNetworkConnectivity.

https://gitlab.gnome.org/GNOME/glib/merge_requests/227
2018-08-27 10:56:02 -04:00
Matthias Clasen
860735f01b portal network monitor: Drop the version property
Rearrange the code so we try version 3 first,
falling back to version 2 and then version 1.

We still do a construct-time check to ensure
that we work with unsupported versions.

Note that this also takes care of setting the
initial property values in the version 1 case.
2018-08-27 10:55:53 -04:00
Matthias Clasen
5c5881b2ed portal network monitor: use GetStatus when available
Version 3 of the portal interface adds a GetStatus
method that gets all data in a single roundtrip.
Use it when available.
2018-08-27 10:55:30 -04:00
Matthias Clasen
a090d8605b portal network monitor: Implement can_reach
Version 3 of the network monitor portal interface adds
a CanReach method. Use it to implement can_reach.

The docs state that can_reach will either return TRUE
or set an error. So, set an error of G_IO_ERROR_HOST_UNREACHABLE
when the portal returns FALSE for CanReach.
2018-08-27 10:55:01 -04:00
Matthias Clasen
3a3a32a2bb portal network monitor: Always emit ::network-changed
The documentation of this signal is not really clear,
but it seems safer to emit it for all changes, even
if available is unchanged.
2018-08-27 10:54:35 -04:00
Matthias Clasen
8f2393b9b6 Whitespace fixup 2018-08-27 10:48:06 -04:00
Iñigo Martínez
64e9e1f482 gio: Provide schemas directory information in pkg-config file
GSettings XML schema files are installed in a well known directory
under Glib's installation directory: `glib-2.0/schemas`. However,
the Glib installation directory might vary, so the exact location of
the schema files might be unknown.

The information regarding this directory has been added to GIO's
pkg-config file, so it can be checked, and also overrided, by using
the command line utility.
2018-08-27 13:50:34 +02:00
Marco Trevisan (Treviño)
5cc4cca9c6 subprocess: Fix communicate_cancelled signature
The source callback for a GCancellable should have the cancellable itself
as first argument.
This was not the case, and when this code was hit, we were instead trying
to treat the pointer as a CommunicateState reference and thus wrongly
deferencing it, causing a memory error and a crash.
2018-08-24 06:05:03 +02:00
Ninja-Koala
0d685b4946
glib-compile-resources: encode data as string
Some Testing revealed encoding resource data with string
escape codes to compile significantly quicker compared
to the same data encoded as an array with hexadecimal numbers.
See #1489
2018-08-23 10:02:56 +02:00
Matthias Clasen
3c1902fcf9 Add a gnet utility
This is currently just a wrapper around GNetworkMonitor.
2018-08-23 02:59:28 +00:00
Philip Withnall
2df9d38635 build: Clean files left behind after gio/tests/gresource.c test
This is a follow-up to commit 614adf8a75,
which started generating two new files as part of the test; they need to
be cleaned up before distcheck will pass.

Ideally, the test should run a temporary directory and wipe that
directory itself before exiting, but that’s a bit of a big change to
make right now. Deferred to
https://gitlab.gnome.org/GNOME/glib/issues/1495.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-22 15:01:56 +01:00
Ting-Wei Lan
9147403893 gtestdbus: Fix watcher crash on FreeBSD
In file gio/gtestdbus.c, function watch_parent, there is a loop which
waits for commands sent from the parent process and kills all processes
recorded in 'pids_to_kill' array on parent process exit. The detection
of parent process exit is done by calling g_poll and checking whether
the returned event is G_IO_HUP. However, 'revents' is a bit mask, and
we should use a bitwise-AND check instead of the equality check here.

It seems to work fine on Linux, but it fails on FreeBSD because the
g_poll returns both G_IO_IN and G_IO_HUP on pipe close. This means the
watcher process continues waiting for commands after the parent process
exit, and g_io_channel_read_line returns G_IO_STATUS_EOF with 'command'
set to NULL. Then the watcher process crashes with segfault when calling
sscanf because 'command' is NULL. Since the test result is already
reported by the parent process as 'OK', this kind of crash is likely to
be unnoticed unless someone checks dmesg messages after the test:

pid 57611 (defaultvalue), uid 1001: exited on signal 11
pid 57935 (actions), uid 1001: exited on signal 11
pid 57945 (gdbus-bz627724), uid 1001: exited on signal 11
pid 57952 (gdbus-connection), uid 1001: exited on signal 11
pid 57970 (gdbus-connection-lo), uid 1001: exited on signal 11
pid 57976 (gdbus-connection-sl), uid 1001: exited on signal 11
pid 58039 (gdbus-exit-on-close), uid 1001: exited on signal 11
pid 58043 (gdbus-exit-on-close), uid 1001: exited on signal 11
pid 58047 (gdbus-exit-on-close), uid 1001: exited on signal 11
pid 58051 (gdbus-exit-on-close), uid 1001: exited on signal 11
pid 58055 (gdbus-export), uid 1001: exited on signal 11
pid 58059 (gdbus-introspection), uid 1001: exited on signal 11
pid 58065 (gdbus-names), uid 1001: exited on signal 11
pid 58071 (gdbus-proxy), uid 1001: exited on signal 11
pid 58079 (gdbus-proxy-threads), uid 1001: exited on signal 11
pid 58083 (gdbus-proxy-well-kn), uid 1001: exited on signal 11
pid 58091 (gdbus-test-codegen), uid 1001: exited on signal 11
pid 58095 (gdbus-threading), uid 1001: exited on signal 11
pid 58104 (gmenumodel), uid 1001: exited on signal 11
pid 58108 (gnotification), uid 1001: exited on signal 11
pid 58112 (gdbus-test-codegen-), uid 1001: exited on signal 11
pid 58116 (gapplication), uid 1001: exited on signal 11
pid 58132 (dbus-appinfo), uid 1001: exited on signal 11

If the watcher process crashes before killing the dbus-daemon process
spawned by the parent process, the dbus-daemon process will keep running
after all tests complete. Due to the implementation of 'communicate'
function in Python subprocess, it causes meson to crash. 'communicate'
assumes the stdout and stderr pipes are closed when the child process
exits, but it is not true if processes forked by the child process
doesn't exit. It causes Python subprocess 'communicate' function to
block on the call to poll until the timeout expires even if the test
finishes in a few seconds. Meson assumes the timeout exception always
means the test is still running. It calls 'communicate' again and
crashes because pipes no longer exist.

https://gitlab.gnome.org/Infrastructure/GitLab/issues/286
https://github.com/mesonbuild/meson/issues/3967
https://bugs.python.org/issue30154
2018-08-20 11:13:19 +01:00
Christoph Reiter
6b833bc2f1 tests: fix gnotification tests broken due to the recent icon name fallback changes
In !72 themed icons were changed to fall back to the symbolic variant.
The gnotification tests were still testing for the old list of names.
2018-08-19 20:04:41 +02:00
Matthias Clasen
dd3e565e94 Use an existing enum value
We have an enum for this, no need to hardcode numbers.
2018-08-18 20:16:03 -04:00
Philip Withnall
f876f4174f Merge branch 'master' into 'master'
gio: icons should fallback to non-preferred style appropriately.

See merge request GNOME/glib!72
2018-08-17 12:49:03 +00:00
Philip Withnall
61a348f287 glocalfile: Only ignore FS full information for FUSE and ncpfs
Previously, glocalfile.c would not set file system metadata for
the free/used key for file systems which reported 0 free space. This is
because some file systems don’t set that metadata when you call
statfs(), so we can’t reliably report it. However, some do, and they
can legitimately set f_bavail and f_bfree to 0 if the file system is
full.

In order to avoid that, always set the file system metadata unless the
file system is FUSE or ncpfs.

This is a partial revert of commit 0b9f24c1e1: instead of the changes
made in that commit, I think we should maintain a blacklist of file
systems which are known to not correctly report free space.

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

https://gitlab.gnome.org/GNOME/glib/issues/328
2018-08-17 12:41:20 +01:00
Matthias Clasen
18997de7e9 network monitor portal: update properties initially
With version 2, we need to query the values explicitly.
The properties made this automatic.
2018-08-16 21:36:13 +00:00
Philip Withnall
1a30a6a1d0 Merge branch 'fix-gdbus-unix-address' into 'master'
Fix failing tests when G_MESSAGES_DEBUG is set (again)

See merge request GNOME/glib!247
2018-08-16 21:27:47 +00:00
Xavier Claessens
9a3c7eca14 Merge branch '1444-install-tests' into 'master'
Resolve "the meson build doesn't support installed tests"

Closes #1444

See merge request GNOME/glib!245
2018-08-16 20:01:06 +00:00
Xavier Claessens
9f208e9f2b Fix failing tests when G_MESSAGES_DEBUG is set (again)
Similar issue was fixed with commit f929d148, but it's happening again.
Define G_MESSAGES_DEBUG=all when running CI to ensure we won't regress
anymore.
2018-08-16 15:55:51 -04:00
Xavier Claessens
c908ce8f8c Meson: install gio tests 2018-08-16 10:53:31 -04:00
Philip Withnall
faa383936e Merge branch '1454-gvdb-corruption' into 'master'
gvdb: Fix error handling in gvdb_table_new()

Closes #1454

See merge request GNOME/glib!214
2018-08-16 14:52:50 +00:00
Iain Lane
1152d99ded Fix trashing on overlayfs
In order to determine whether to trash a file to the home directory, we
compare its st_dev to our home directory's st_dev field.

This is the wrong thing to do on overlayfs when deleting files, because
st_dev contains the ID of the filesystem providing the file (which can
be the lower or upper filesystem), but directories always return the ID
of the overlayfs. Thus the comparison fails and we are unable to trash
the file.

Fix this by checking st_dev of the parent directory when we are deleting
a file.

Also adjust `test_trash_not_supported` for this - make its st_dev check
look at the parent directory's `st_dev` rather than the temporary file's
own.

Fixes #1027.
2018-08-13 17:41:59 +01:00
Iain Lane
93f3cb7c6d Revert "glocalfile: Check that parent device is the same when trashing"
This reverts commit 15cdcd2e0b.
2018-08-13 17:23:21 +01:00
Philip Withnall
614adf8a75 gvdb: Fix error handling in gvdb_table_new()
The documentation was unclear about what error codes would be returned
on attempting to open an empty or corrupt GVDB file. Previous versions
of the documentation incorrectly said that corrupt GVDB files were
considered equivalent to empty ones.

A recent commit has clarified the documentation to include its error
handling behaviour.

Update the two users of GVDB within GLib, GResource and GSettingsSource,
to follow this change, and add unit tests for them both.

Other users of the GVDB copylib will need to update their copy and make
appropriate changes if they have bugs in their handling of this
situation. dconf is one example of this. GVDB should be updated from
https://gitlab.gnome.org/GNOME/gvdb.

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

https://gitlab.gnome.org/GNOME/glib/issues/1454
2018-08-13 15:38:34 +01:00
Philip Withnall
c652d45c97 gsettingsschema: Port to new GVDB API
This should introduce no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 15:37:05 +01:00
Philip Withnall
705dd2b9a9 gresource: Port to new GVDB API
This should introduce no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 15:37:05 +01:00
Philip Withnall
ce86a3aed7 glib-compile-schemas: Fix a minor memory leak
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 15:37:05 +01:00
Philip Withnall
c9834f234d Merge remote-tracking branch 'gvdb/master' into update-gvdb
Minor merge conflicts in gvdb-reader.c with the documentation.
2018-08-13 15:35:52 +01:00
Arnaud B
438547641f Fix indicative gschema.dtd regarding range.
The range can have only a "min" or only a "max" attribute, and can even have no attributes at all.
2018-08-13 08:19:57 +00:00
Руслан Ижбулатов
075bb0f751 W32: consider NTFS mounpoints to be symlinks
While mountpoints are *not* symlinks, strictly speaking,
they works in a similar enough way, so consider them to be
symlinks for the purpose of querying local file info.
2018-08-08 23:41:07 +00:00
Руслан Ижбулатов
929844fdf7 W32: correctly use st_ctime
On Windows st_ctime field is the file creation time.
POSIX mandates that field to be the file state change time.
Naturally, glib code interpreted st_ctime as POSIX suggested,
and the result was bad.
Fix this by introducing special W32-only logic for setting
attributes from st_ctime field.

Fixes issue #1452.
2018-08-08 23:41:02 +00:00
Pavlo Solntsev
7e2dfa8c44 DOC: Documentation fix in GTask description 2018-08-08 00:17:15 -05:00
Michael Catanzaro
4536deb5af Add a new GTlsError to indicate protocol downgrade attacks
G_TLS_ERROR_MISC suffices, but it's nicer to have a new error here.
2018-08-07 08:20:03 -05:00
Philip Withnall
ab09a5f5a9 gdbusmessage: Fix a typo in the documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-07 11:04:00 +01:00
Philip Withnall
a5f824451f Merge branch 'mcatanzaro/tls-docs' into 'master'
Update TLS documentation

See merge request GNOME/glib!199
2018-08-07 09:46:30 +00:00
Michael Catanzaro
08fe93589e Update documentation of g_tls_client_connection_set_use_ssl3()
We now send the fallback SCSV, meaning use of this function will cause
modern servers to immediately terminate the connection, so let's warn
API users to expect that behavior and be crystal clear that this
function should only be used as a fallback when a normal connection
attempt has already failed.

Also, the documentation is mostly duplicated between the property and
the function, so let's just reference the function documentation from
the property.
2018-08-04 16:33:28 -05:00
Christoph Reiter
99caee2819 build: only test for broken ip_mreq_source on Android. Fixes #1472
7efd76dd67 added these configure time tests to work around a bug
with older Android. Since the test didn't take Windows into account it
wrongfully applied the workaround on Windows too, breaking the build.
With meson this wasn't an issue since the check is skipped on Windows there
and our CI didn't catch this issue.

Change the test to run on Android only for meson and autotools.
This also makes it clear that the test+code can be dropped again if we stop
supporting older Android versions at some point.
2018-08-03 10:24:00 +02:00
Philip Withnall
7f5296d055 Merge branch 'wip/oholy/update-mounts' into 'master'
Be sure that g_volume_get_mount succeed after g_volume_mount

See merge request GNOME/glib!217
2018-08-02 15:40:50 +00:00
Ondrej Holy
3edc50498f glocalfilemonitor: Fallback to poll file monitor for NFS
GLib currently tries to use FAM volume monitor for monitoring files
within home on NFS. If FAM support is not available, it fallbacks by
default to GInotifyFileMonitor. I think we should fallback to
GPollFileMonitor instead, because inotify is not reliable on NFS,
which may cause issues for dconf. With this patch, it should be safe to
not build libgiofam and still be sure that dconf works properly if home
is mounted on NFS. I think this might be a first step to remove FAM
support from GLib completely, because gamin is buggy and dead for
several years already. Gamin just polls files on NFS anyway. This
change applies on files only, because GPollFileMonitor seems doesn't
support dirs, however it should be enough for dconf. The other
drawback is that one can't set poll timeout currently. Just a note
that this can still be overwritten by GIO_USE_FILE_MONITOR.
2018-08-02 13:14:10 +02:00
Ondrej Holy
88b8ebb5dd gio-tool: Hold GVolumeMonitor reference during operations
Releasing GVolumeMonitor before g_volume_mount finish cause that
g_volume_get_mount returns NULL, because the mount is not correctly
propagated to the volume.

https://gitlab.gnome.org/GNOME/glib/issues/1458
2018-08-02 11:35:48 +02:00
Christoph Reiter
70ad484508 gresource-tool: fix build in case libelf is available on Windows. Fixes #1466
The gresource code uses libelf if available but that also depends on mmap but isn't
guarded with HAVE_MMAP. This can make the build fail under MSYS2 where a mingw version
of libelf exists but there is no mmap.

Instead of guarting the libelf code with HAVE_LIBELF add a new macro named USE_LIBELF
which is only defined if libelf and mmap support are available.

Also install the mingw libelf version for CI so we catch similar errors in the future.
2018-08-01 19:08:39 +02:00
Emmanuele Bassi
26c3f2f1b1 Install gioenumtypes.h
We're re-defining nodist_gioinclude_HEADERS and Automake will use the
last definition of the target.
2018-07-31 09:40:22 +01:00
Philip Withnall
2a69cdb1cd build: Stop distributing generated files in autotools tarballs
It is a bug if we distribute files which are generated at build time —
they should be built on the machine which is compiling GLib, not be
shipped in the tarball.

This brings the autotools-generated tarball in line with the
ninja-generated one, with the exception of man pages and gtk-doc HTML
output.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-30 19:58:24 +01:00
Mohammed Sadiq
24f5dbca2c gio/tests: Use the right format specifier
dev_t - the type of st_dev - is always 8 byte.
Use G_GUINT64_FORMAT to ensure 8 byte and thus not fail on i386.
2018-07-30 20:53:15 +05:30
Ondrej Holy
9b6b282e0a gio: Update mounts after g_volume_mount
The documentation claims that g_volume_get_mount should	succeed	after
g_volume_mount. Let's update mounts before releasing g_volume_mount to
be sure that the mount is added to the corresponding volume. The same
is done in GVfsUDisks2VolumeMonitor.

https://gitlab.gnome.org/GNOME/glib/issues/1458
2018-07-30 16:05:41 +02:00
Michael Catanzaro
94a99ae917 Update documentation of g_tls_connection_handshake
Rehandshaking is not a thing in TLS 1.3. In that case,
g_tls_connection_handshake() should instead perform a re-key.
2018-07-27 10:48:50 -05:00
Matthias Clasen
56092b8529 Revert "Add a gnet utility"
This reverts commit 1db3b6def6.

I had forgotten to remove this from the branch before merging.
2018-07-25 07:18:38 -04:00
Matthias Clasen
2480ece23d Merge branch 'new-network-portal' into 'master'
New network portal

See merge request GNOME/glib!192
2018-07-25 11:16:51 +00:00
Nirbheek Chauhan
4e1488eebb Merge branch 'meson-python-module' into 'master'
meson: use the new 'python' module instead of the 'python3' one

Closes #1455

See merge request GNOME/glib!187
2018-07-23 11:17:47 +00:00
Matthias Clasen
1db3b6def6 Add a gnet utility
This is currently just a wrapper around GNetworkMonitor.
2018-07-21 08:21:58 -04:00
Matthias Clasen
7217fe56e0 Stop generating code for NetworkMonitor
The portal implementation no longer uses generated
code for org.freedesktop.portal.NetworkMonitor.
2018-07-21 08:21:43 -04:00
Matthias Clasen
5ed808d7c4 network monitor: Update portal implementation
The network monitor portal interface is changing.
Version 2 is no longer using properties, but getters
instead (this lets the portal apply access control
and avoid sending information to non-networked
sandboxes).

To support both version 1 and 2 of the interface,
we stop using generated code and instead deal with
the api differences in our own code, which is not
too difficult.

Support version 1 as well
2018-07-21 08:19:16 -04:00
Matthias Clasen
e0b120cc3c Add debug spew to module loading
This is useful to verify which modules are loaded, and why.
2018-07-20 18:53:09 -04:00
Christoph Reiter
631c3534b7 meson: use the new 'python' module instead of the 'python3' one. Closes #1455
The new python module, added with 0.46, works with Python 2 and 3 and
allows to pass a path for the interpreter to use, if the need arises.

Previously the meson build set PYTHON, used in the shebang line of
the scripts installed by glib, to the full path of the interpreter.
The new meson module doesn't expose that atm, but we should set it to
a executable name anyway, and not a full path.
2018-07-19 12:32:29 +02:00
Nirbheek Chauhan
057f393bbb meson: Provide our Python tools for builds
Several of our tools are installed and are used by other projects to
generate code. However, there is no 'install' when projects use glib
as a subproject.

We need some way for glib to 'provide' these tools so that when some
project uses glib as a subproject, find_program('glib-mkenums') will
transparently return the glib-mkenums we just built.

Starting from Meson 0.46, this can be done with the
`meson.override_find_program()` function.

As a bonus, the Meson GNOME module will also use these
'overriden'/'provided' programs instead of looking for them in PATH.
2018-07-19 15:53:37 +05:30
Javier Jardón
5f6895d741 gio/Makefile.am: Use PYTHON to call python script 2018-07-17 12:26:34 +01:00
Philip Withnall
b5948c1a39 gsettings: Fix some memory leaks on error paths
Coverity CID: #1393949
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2018-07-17 12:14:07 +02:00
Philip Withnall
2c79b357b2 gio-tool: Fix a memory leak when returning command line help
Coverity CID: #1393952
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2018-07-17 12:13:21 +02:00
Xavier Claessens
f456e311cd Meson: Use environment() for test_env 2018-07-16 15:04:03 -04:00
Xavier Claessens
c96f987f0d Merge branch '786-gio-test-leaks' into 'master'
Fix memory leaks in libgio tests and ensure tests are run under Meson

Closes #786

See merge request GNOME/glib!151
2018-07-13 15:46:21 +00:00
Thomas Hindoe Paaboel Andersen
a8b416f9fe python: avoid equality check for None
PEP8 says that:
"Comparisons to singletons like None should always be done with is or
is not, never the equality operators."

glib uses a mix of "== None" and "is None". This patch changes all
cases to the latter.
2018-07-12 23:48:41 +02:00
Philip Withnall
3890f7f5cb tests: Fix skipping of appinfo tests when DISPLAY is unset
Use g_test_skip() so that the TAP output is correct for the tests,
rather than printing using g_printerr().

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

https://gitlab.gnome.org/GNOME/glib/issues/640
2018-07-11 15:58:48 +02:00
Emmanuele Bassi
ad3947c42e Merge branch '927-resource-path-fix' into 'master'
gresource: Fix potential array overflow if using empty paths

Closes #927

See merge request GNOME/glib!150
2018-07-11 09:24:03 +00:00
Philip Withnall
3475afc255 Merge branch '1402-real-time' into 'master'
glib: Don’t use time(NULL) to get current time

Closes #1402

See merge request GNOME/glib!154
2018-07-11 07:51:06 +00:00
Philip Withnall
034bbfd873 gdbusconnection: Drop an outdated TODO comment
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/340
2018-07-10 19:16:35 +02:00
Philip Withnall
92e059280f glib: Don’t use time(NULL) to get current time
Use either g_get_real_time() or g_date_time_new_now_local(). This means
we don’t need to worry about time_t being 32b in future (the year 2038
problem), and it makes the need for error handling a bit more explicit.
Improve the error handling in several cases.

Based on a patch by Niels De Graef
(https://gitlab.gnome.org/GNOME/glib/merge_requests/142).

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

https://gitlab.gnome.org/GNOME/glib/issues/1402
2018-07-09 13:28:02 +02:00
Philip Withnall
9d6a69b73e gio: Link inotify file monitor to GLib and GObject
Apparently this is needed for building PE libraries. It makes no
difference on Linux, where linking of the GLib symbols in the inotify
file monitor code is done lazily.

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

https://gitlab.gnome.org/GNOME/glib/issues/1201
2018-07-09 10:38:04 +01:00
Adrian Perez de Castro
657be4f5fc
gio: Add missing autocleanup definition for GResource
Fixes #1435
2018-07-07 19:44:19 +03:00
Philip Withnall
6438e2c731 tests: Mark gdbus-threading test as slow
It often takes a bit more than 30s on my local machine to run.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-06 15:01:40 +01:00
Philip Withnall
5422838e8d tests: Move two tests from GIO uninstalled helpers to test cases list
These are built and run as tests in the autotools build, and use GTest.
They are tests.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-06 14:58:25 +01:00
Philip Withnall
cfc26b5a41 tests: Rework slow test handling for GIO tests
Make it follow the same pattern as in glib/tests/meson.build, using a
slow_tests array.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-05 17:14:53 +01:00