Commit Graph

17482 Commits

Author SHA1 Message Date
Maks Naumov
12e32e96a3 Don't skip invalid enum values in schemas
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742997
2017-10-11 10:22:23 +01:00
Jan Alexander Steffens (heftig)
30b25a6fd9 meson: Fix permissions of installed scripts
configure_file preserves the attributes, so the templates need to be
executable for the (installed) outputs to be executable.

https://bugzilla.gnome.org/show_bug.cgi?id=787671
2017-10-11 09:49:26 +01:00
Nirbheek Chauhan
b9f2ea4235 gdbus-codegen: Don't assume bindir and datadir share prefix
This assumption breaks when, for instance:

* Called as /bin/gdbus-codegen
* Installed on Windows in a directory that is not `bin/`

For such cases, we cannot make any assumptions about the directory
structure, and must hard-code the datadir.

https://bugzilla.gnome.org/show_bug.cgi?id=786785
2017-10-11 09:48:38 +01:00
Nirbheek Chauhan
62dedcb099 gmacros: Fix deprecations support with ICC
ICC defines __GNUC__ (to emulate GCC), but has its own method of
disabling deprecations.

https://bugzilla.gnome.org/show_bug.cgi?id=776562
2017-10-11 09:47:02 +01:00
grindhold
5b64522fcb socket: fix typo in get_remote_address docs
fixed the following typo:
"remove address" → "remote address"

https://bugzilla.gnome.org/show_bug.cgi?id=788766
2017-10-10 11:31:49 +01:00
Emmanuele Bassi
dc39232ded Do not build journal integration on older Linux platforms
We need to add more checks for journal_sendv(), as we depend on the
presence of mkostemp() and O_CLOEXEC, which may not be available on
older Linux platforms, like RHEL 5.

https://bugzilla.gnome.org/show_bug.cgi?id=788705
2017-10-09 12:45:59 +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
Emmanuele Bassi
7b15f12f0e Remove PERL_PATH from Autotools build
We don't use Perl for glib-mkenums any more.
2017-10-09 12:45:18 +01:00
Chun-wei Fan
2c6c03290f gio: Fix gio-tool-open.c on Windows/Cocoa
Commit 7384e37 broke builds on these platforms as *NIX-only APIs are
being used unconditionally.  Fix the build by building these portions
when not on Windows or Cocoa.

https://bugzilla.gnome.org/show_bug.cgi?id=780296
2017-10-09 09:10:48 +08:00
Justin Kim
7e70dd88c9 gmodule: Use RTLD_DEFAULT if defined __BIONIC__
This is a partial change of the previous work[0].
On 64 bit Android since android-23, 'handle = dlopen(NULL); dlsym(handle)'
doesn't work. Instead, only 'dlsym(RTLD_DEFAULT)' returns a valid pointer.

However, RTLD_DEFAULT is defined as '(void *) 0x0' on 64bit Android which
is usually used for invalid value so this patch allows the specific case.

[0] 0d81bb4e31

https://bugzilla.gnome.org/show_bug.cgi?id=788270
2017-10-06 21:09:47 +03:00
Philip Withnall
860dc949ca tests: Add some assertions on some otherwise-unused variables
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=751738
2017-10-06 12:57:06 +01:00
SilentFlame
bd2fa54637 glib: Correct typos of ‘character’
https://bugzilla.gnome.org/show_bug.cgi?id=774083
2017-10-06 12:49:12 +01:00
Christian Persch
2bdec0c2f2 gbytes: Fix check in try_steal_and_unref
Need to check if the user data is equal to the data, before
taking the data out of the GBytes!

Bug #670139.
2017-10-06 12:41:35 +01:00
Andrew Borodin
7895706c82 Type accuracy for result of strlen() in string utilities
https://bugzilla.gnome.org/show_bug.cgi?id=630983
2017-10-06 12:32:10 +01:00
Philip Withnall
5040de9fc7 docs: Mention gsize, goffset, etc. are in C99
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=569375
2017-10-06 12:14:59 +01:00
Philip Withnall
493723b4d9 gmessages: Update advice for G_LOG_DOMAIN
Suggest defining it for all code — for applications as well as for
libraries. This allows G_MESSAGES_DEBUG=my-app to be used to filter out
all messages from libraries which it uses, for example.

https://bugzilla.gnome.org/show_bug.cgi?id=777956
2017-10-06 11:26:47 +01:00
Philip Withnall
8330b09d78 Bug 679467 — Mention translation in g_warning() documentation
Include a line in the documentation for g_warning(), g_error(), g_critical()
and g_debug() mentioning that the messages passed to them typically should not
be translated.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=679467
2017-10-06 11:23:01 +01:00
Philip Withnall
0a10f7375f glocalfileinfo: Use g_strcmp0() for some comparisons which might be NULL
The return value from g_get_user_special_dir() might be NULL. Safest to
use g_strcmp0() uniformly everywhere.

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

https://bugzilla.gnome.org/show_bug.cgi?id=661442
2017-10-06 11:17:40 +01:00
Philip Withnall
9cbff9f768 gclosure: Fix (transfer) annotations on GClosure constructors
They return floating references. The convention established by GVariant
is to annotate these as (transfer none) so that the caller does a
ref+sink on them, rather than just a ref.

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

https://bugzilla.gnome.org/show_bug.cgi?id=677233
2017-10-06 11:17:33 +01:00
Philip Withnall
121b1e5215 docs: Fix incorrect macro name in GType tutorial
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=770459
2017-10-05 15:40:14 +01:00
Colomban Wendling
b090a079f7 Fix documentation about stopping signal emission from inside a hook
Stopping signal emission from an emission hook is, and always has been,
actually forbidden.  Update the documentation not to lie to the reader.

https://bugzilla.gnome.org/show_bug.cgi?id=773355
2017-10-05 15:26:08 +01:00
Ondrej Holy
1508db2f66 gio: Add hack to close up dbus-daemon race
If gio open exits before the program it starts fully activates, then
the dbus-daemon may avoid doing the activating method call.

This commit works around the problem by pinging the activated application,
and waiting for a reply.

Same workaround is used in gtk-launch and was used in gvfs-open before
it was replaced by gio open.

https://bugzilla.gnome.org/show_bug.cgi?id=780296
2017-10-05 16:19:31 +02:00
Volker Sobek
c7dc81ce78 docs: Escape some backslashes for markdown
These no longer showed up correctly in the documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=727346
2017-10-05 15:07:09 +01:00
Martin Blanchard
d3745d14e1 gprintf: Add a reminder concerning <glib/gprintf.h>
g_printf(), g_fprintf(), g_sprintf(), g_vprintf(), g_vfprintf(),
() and g_vasprintf() require gprintf.h to be explicitly included
in order to be used. This patch adds a reminder in each function's
documentation abstract.

https://bugzilla.gnome.org/show_bug.cgi?id=760716
2017-10-05 15:02:39 +01:00
Martin Blanchard
c443adeffb gprintf: Fix documentation regarding <glib/gprintf.h>
g_snprintf() and g_vsnprintf() declarations were moved and
don't require gprintf.h to be included anymore but g_vasprintf()
is and requires gprintf.h to be explicitly included.

https://bugzilla.gnome.org/show_bug.cgi?id=760716
2017-10-05 15:01:28 +01:00
Philip Withnall
85680f4a06 docs: Rewrap line to avoid it being interpreted as a list
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=767215
2017-10-05 14:49:49 +01:00
Jiro Matsuzawa
acea147cbc gsettings: Suppress error messages of completion
https://bugzilla.gnome.org/show_bug.cgi?id=695681
2017-10-05 14:41:24 +01:00
Philip Withnall
55905db86a gfile: Fix typo in documentation for g_file_set_attribute()
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-10-05 13:46:41 +01:00
Aurélien Zanelli
21d2c64660 gfileutils: add some sanity checks
To avoid handling non-null GError or NULL filename.

https://bugzilla.gnome.org/show_bug.cgi?id=754026
2017-10-05 13:42:19 +01:00
Xavi Ivars
eb5120d0df
[l10n] Updated Catalan (Valencian) translation 2017-10-05 13:56:23 +02:00
Simon McVittie
733c7bd9c5 g_test_log: Consistently use GLib whitespace style
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=788467
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-10-03 17:22:48 +01:00
Simon McVittie
23ba8aec92 testutils: Report fatal errors and warnings as TAP
Lines starting with "Bail out!" are special TAP syntax: they mark
the entire test execution (one binary or script) as failed, and stop
processing. Automake's parallel test harness knows this, and will print
the diagnostic in the test results, leading to clearer output.

Without this change, having changed glib/tests/bytes.c to emit a
spurious g_warning():

ERROR: bytes - too few tests run (expected 15, got 0)
ERROR: bytes - exited with status 133 (terminated by signal 5?)

With this change, it's clearer what has happened:

ERROR: bytes - Bail out! FATAL-WARNING: I broke this as a demonstration

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=788467
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-10-03 15:16:15 +01:00
Philip Withnall
81d7af312e gmem: Make it more obvious that g_mem_set_vtable() does nothing
Clarify the big deprecation warning in the documentation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-10-03 09:36:08 +01:00
Jeremy Bicha
2afcf6c393 trivial: tweak Spanish translation header 2017-10-02 22:06:18 -04:00
Matthias Clasen
8be9a6f020 Revert "Prepare for 2.54.1"
This reverts commit 9a08d3ef8f.

Turns out there's new api here already.
2017-10-02 10:54:58 -04:00
Matthias Clasen
9a08d3ef8f Prepare for 2.54.1 2017-10-02 10:45:53 -04:00
Philip Withnall
702b6af87c gtestutils: Explicitly cast args to g_assertion_message_cmpnum()
This avoids warnings when compiling with -Wconversion on 32-bit
architectures, as the conversion to (long double) is not necessarily
lossless. We don’t care about that, though, since the actual comparison
was done with the correct types, and g_assertion_message_cmpnum() is
only used to print failure information.

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

https://bugzilla.gnome.org/show_bug.cgi?id=788385
2017-10-02 15:32:46 +01:00
Philip Withnall
0e888bdf52 gtypes: Fix signedness of __builtin_bswap() usage
In GUINT64_TO_BE(), for example, when compiling with -Wsign-conversion,
we get a warning due to an implicit cast from (gint64) to (guint64) when
passing the argument to __builtin_bswap64().

According to the GCC documentation, __builtin_bswap64() takes an
unsigned argument:

https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

Cast the input appropriately.

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

https://bugzilla.gnome.org/show_bug.cgi?id=788384
2017-10-02 15:31:20 +01:00
Philip Withnall
b0cbd21b25 glib-compile-resources: Fix leak of a GHashTable
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788138
2017-10-02 15:30:23 +01:00
Ondrej Holy
f6fa90fb0d gunixmounts: Fix mount points generation
Commit 53ed180 improved mtab processing, however, also introduced bug
in code obtaining mount points. mtab was used by mistake also for
g_unix_mount_points_get implementation, which is obviously wrong and
fstab has to be used instead...

https://bugzilla.gnome.org/show_bug.cgi?id=781867
2017-10-02 12:19:51 +02:00
Matej Urbančič
d4a21e001a Updated Slovenian translation 2017-09-29 08:41:37 +02:00
Philip Withnall
330e6911b5 goutputstream: Add missing (optional) annotations to bytes_written args
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-09-27 10:31:34 +01:00
Nelson Benítez León
c1a31c3aaa gio/gunixmounts.c: Don't use mtime to monitor mounts on /proc/
Fix get_mounts_timestamp() to not use a stat'ed mtime for /proc/ files.
Instead, use mount_poller_time if /proc/ watch is running, or otherwise
return a new generated timestamp to always assume mounts-changed, which
is safer than previous behaviour of always assuming mounts-not-changed
(as mtime never changes for /proc/ files when queried from the same
process).

We say it's safer because allows caches depending on:

g_unix_mounts_get(&time_read)
g_unix_mounts_changed_since()

to drop possibly outdated/duplicated values, as that was the case for the
GIO mounts cache used in gio/glocalfile.c which provides mount info for
g_file_query_filesystem_info() call, as described in below referenced bug.

This fix complements related commit bd9e266e11

https://bugzilla.gnome.org/show_bug.cgi?id=787731
2017-09-22 20:28:44 +05:00
Nelson Benítez León
32a9b88b20 gio/tests: Add testcase for bug 787731
Add testcase for function g_file_query_filesystem_info()
reporting outdated info for "filesystem::readonly" attribute
when said attribute was different in a previous mounted
partition in the same device (as GIO maintains a mounts cache
per 'st_dev' stat() member).

To trigger a mount operation, testcase uses program 'bindfs'
instead of 'mount --bind' as bindfs does not require root
privileges. And 'fusermount -u' command is used to unmount said
bindfs mount.

As a reference in Fedora, 'bindfs' is installed from 'bindfs'
package and 'fusermount' from 'fuse' package (this one is installed
by default as being part of 'System Tools' group).

The test creates a directory with a file in it, then mounts it
readonly over another directory (the mountpoint), it then checks
that g_file_query_filesystem_info() for the file in it indeed reports
"filesystem::readonly" as TRUE. Then unmounts and mounts again this
time rw (not readonly), it then checks again if g_file_query_filesystem_info()
is reporting "filesystem::readonly" as TRUE, if that's the case, it
confirms the bug by opening said file in write mode.

Testcase is only added for Unix builds.

https://bugzilla.gnome.org/show_bug.cgi?id=787731
2017-09-22 20:28:44 +05:00
Philip Withnall
1304197ed0 gmessages: Fix a typo in the documentation for g_log_set_handler_full()
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-09-22 13:34:19 +01:00
Philip Withnall
09796b3ccc Partially revert "gio: Add missing (array length) annotations"
This reverts commit 8028494335.

Adding (array length=…) to a gchar* parameter causes the GIR file to
contain an array of strings, rather than an array of characters. While
we fix GIR, revert those changes.

Some of the other changes in the file (which have an explicit
(element-type) already) are fine.

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

https://bugzilla.gnome.org/show_bug.cgi?id=765063
2017-09-21 12:05:06 +01:00
Alisa Maas
8028494335 gio: Add missing (array length) annotations
https://bugzilla.gnome.org/show_bug.cgi?id=765063
2017-09-21 11:08:12 +01:00
Matej Urbančič
e7a60ed262 Updated Slovenian translation 2017-09-20 14:11:11 +02:00
Chun-wei Fan
213c31a49d build: Change DLL naming in Visual Studio projects
The previous commit to glib/glibconfig.h.win32.in, though it improves
the state of GLib and fixes bugs, cannot be used as a drop-in
replacement for code that builds against the previous
glib/glibconfig.h(.win32.in) that were build using the Visual Studio
projects.  Change the DLL names as a result so that the likelihood of
problems caused by replacing existing GLib DLLs can be reduced--code
that was built against previous GLib MSVC builds should be rebuilt, so
that things will work with the newer DLLs, instead of depending on the
older DLLs.

Note that if Visual Studio builds are done through Meson, existing code
that link against GLib should be rebuilt as well, for the same reason.
DLLs built with the Visual Studio projects from 2.55.0 onwards should be
compatible with the ones that are built with Visual Studio via Meson.
2017-09-15 12:56:40 +08:00
Chun-wei Fan
4fd056a5f5 glib/glibconfig.h.win32.in: Update and clean up
Make the entries in here more consistent with what Meson produces with
its Visual Studio builds.  Also fix the macros [GSIZE|GSSIZE]_TO_[LE|BE]
for x64 builds.
2017-09-15 12:50:50 +08:00