Commit Graph

19002 Commits

Author SHA1 Message Date
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
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
Matthias Clasen
54074a3187 Merge branch 'mcatanzaro/gdbus-error' into 'master'
gdbus: Improve error when well-known name is unowned

See merge request GNOME/glib!316
2018-09-12 19:40:01 +00: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
LRN
cf4ea5ef75 Merge branch 'w32-gfileinfo-improvements' into 'master'
W32 GFileInfo improvements

See merge request GNOME/glib!238
2018-09-12 15:15:00 +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
Руслан Ижбулатов
256e741248 W32: tighten access rights requested to read symlink
According to
http://blog.kalmbach-software.de/2008/02/28/howto-correctly-read-reparse-data-in-vista/
we only need FILE_READ_EA, and should also use wider share flags.
2018-09-12 14:35:14 +00:00
Руслан Ижбулатов
a86eb1a8b6 W32: test the private path-stripping function 2018-09-12 14:35:13 +00:00
Руслан Ижбулатов
05fdd09740 W32: Don't always strip path prefixes
Extended path prefix looks like "\\?\",
and NT object path prefix looks like "\??\".
Strip them only if they are followed by a character
(any character) and a colon (:), indicating that
it's a DOS path with a drive.
Otherwise stripping such prefix might result in a patch
that looks like a relative path.

For example, "\\?\Volume{GUID}\" becomes "Volume{GUID}\",
which is a valid directory name.

Currently it's up to the user to make sense of such paths.
2018-09-12 14:35:09 +00:00
Xavier Claessens
d6da69f07d Merge branch 'issue-1520' into 'master'
Install m4 macros unconditionally

Closes #1520

See merge request GNOME/glib!314
2018-09-10 13:02:48 +00:00
Emmanuele Bassi
e8fde0b9e7 Install m4 macros unconditionally
Partial revert of commit a7a6449f4d.

Checking for the availability of m4 for installing m4 macro files
creates an implicit dependency on m4 even if GLib does not need it; this
prevents building GLib and then installing Autotools in order to build a
project that depends on GLib.

Closes #1520
2018-09-10 12:44:59 +01:00
Anders Jonsson
b7fba1a5e3 Update Swedish translation 2018-09-07 18:15:20 +00:00
Iain Lane
d0aba9363e Merge branch '1119-volume-monitor-main-loop-docs' into 'master'
gvolumemonitor: Document the need to run a main loop

Closes #1119

See merge request GNOME/glib!310
2018-09-07 12:28:44 +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
d2f412590e Merge branch 'wip/gtimeval-document-year-2038-problem' into 'master'
Document that GTimeVal is subject to the year 2038 problem on 32-bit systems

See merge request GNOME/glib!302
2018-09-05 10:55:43 +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
dfa2a4ae75 gtestutils: Print non-matching stderr/stdout output on trap failure
When running a test as a subprocess and matching its output, it’s very
annoying for GLib to tell you that the output didn’t match your pattern,
*but not actually say what the output was*. Fix that.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-09-05 11:25:03 +01:00
Emmanuele Bassi
46c1a45dc1 Merge branch '277-closure-docs' into 'master'
gclosure: Clarify when destroy notifiers are called in documentation

Closes #277

See merge request GNOME/glib!246
2018-09-05 10:13:48 +00:00
Emmanuele Bassi
515c39b0a9 Merge branch '1493-dtrace-consts' into 'master'
dtrace: Add missing const attributes to types in glib_probes.d

See merge request GNOME/glib!272
2018-09-05 10:13:14 +00:00
Emmanuele Bassi
3da4314205 Merge branch 'hash-table-tests' into 'master'
tests: Add more tests to finish branch coverage of GHashTable

See merge request GNOME/glib!289
2018-09-05 10:12:07 +00:00
Emmanuele Bassi
fd2d94dca5 Merge branch '656-format-security' into 'master'
build: Set -Wformat when testing for -Wformat-security

Closes #656

See merge request GNOME/glib!300
2018-09-05 09:42:33 +00: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
Philip Withnall
fbe8f247cc Merge branch 'remove-changelogs' into 'master'
Remove all ChangeLog files

See merge request GNOME/glib!292
2018-09-04 22:04:40 +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
93b9f22369 build: Enable -Wimplicit-fallthrough by default 2018-09-04 20:24:25 +02:00
Benjamin Otte
3aff811d13 Use G_GNUC_FALLTHROUGH where appropriate 2018-09-04 20:24:25 +02:00
Benjamin Otte
95477a4e35 macros: Add G_GNUC_FALLTHROUGH
Expands to the GNU C fallthrough statement attribute if the compiler is gcc.
This allows declaring case statement to explicitly fall through in switch
statements. To enable this feature, use -Wimplicit-fallthrough during
compilation.
2018-09-04 20:24:21 +02:00
Christoph Reiter
24a95056b4 autotools: stop generating a ChangeLog file for the dist tarball
We have git for that.

automake requires a ChangLog file in gnu mode so switch to the less strict
foreign mode instead.
2018-09-04 17:43:37 +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
Iain Lane
68a4e273b4 Document that GTimeVal is subject to the year 2038 problem on 32-bit systems
It might not be immediately obvious that this is the case. Let's record
it in the description of `GTimeVal` itself and also in
`g_time_val_from_iso8601`.

We also drop an incorrect statement in the documentation for
`g_time_val_from_iso8601` stating that years up to 3000 were supported;
this is also not true for the same reason.

Related: #1509
2018-09-04 11:15:25 +01:00
Iain Lane
5b7a16a3c6 Merge branch 'wip/test_timeval_to_iso8601_overflow-skip-on-32-bit' into 'master'
tests/timer: Skip test_timeval_to_iso8601_overflow if we can't overflow a GTimeVal

Closes #1509

See merge request GNOME/glib!299
2018-09-04 09:42:35 +00:00
Iain Lane
f697f6aa08 tests/timer: Skip test_timeval_to_iso8601_overflow if we can't overflow a GTimeVal
On 32 bit systems, the size of a long might be the same as the size of
an int. In that case, we won't be able to get an overflow when
converting from a GTimeVal to a time_t. Skip the test for this in that
case.

Closes #1509
2018-09-04 10:31:52 +01:00
Philip Withnall
9e9db46a49 build: Drop pointless -Wformat-security warning flag
We already set -Wformat=2, which implies -Wformat-security, so there’s
no need to test for and set -Wformat-security separately.

The test for -Wformat-security never worked anyway, since gcc complains
if it’s specified without also setting -Wformat to some value. The
complaint causes configure.ac/meson.build to assume the option doesn’t
work.

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

https://gitlab.gnome.org/GNOME/glib/issues/656
2018-09-04 09:51:49 +01: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
Christoph Reiter
0232cf64c6 Merge branch '1313-die-ac-c-const' into 'master'
build: Drop AC_C_CONST from configure.ac

See merge request GNOME/glib!297
2018-09-03 14:29:12 +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
b79bafccfe Merge branch 'glib-gettextize' into 'master'
meson: fix typo

See merge request GNOME/glib!295
2018-09-03 12:18:36 +00:00