platform/upstream/glib.git
9 years agotests: Use de_DE.UTF-8 instead of de_DE
Ting-Wei Lan [Wed, 29 Apr 2015 06:55:00 +0000 (14:55 +0800)]
tests: Use de_DE.UTF-8 instead of de_DE

de_DE.UTF-8 is supported by more operating systems, including FreeBSD,
NetBSD and OpenBSD.

https://bugzilla.gnome.org/show_bug.cgi?id=748612

9 years ago2.45.1 2.45.1
Matthias Clasen [Thu, 30 Apr 2015 17:40:42 +0000 (13:40 -0400)]
2.45.1

9 years agoUpdates
Matthias Clasen [Thu, 30 Apr 2015 16:46:20 +0000 (12:46 -0400)]
Updates

9 years agoUpdated Hebrew translation
Yosef Or Boczko [Wed, 29 Apr 2015 11:23:50 +0000 (14:23 +0300)]
Updated Hebrew translation

9 years agogmarkup: Make append_escaped_text() slightly more robust.
Hans Petter Jansson [Tue, 28 Apr 2015 14:50:42 +0000 (16:50 +0200)]
gmarkup: Make append_escaped_text() slightly more robust.

https://bugzilla.gnome.org/show_bug.cgi?id=631597

9 years agoregex test: do not assert that system PCRE allows "(?P<1>)"
Simon McVittie [Sun, 20 Jul 2014 18:34:54 +0000 (19:34 +0100)]
regex test: do not assert that system PCRE allows "(?P<1>)"

Perl >= 5.18, and PCRE >= 8.34, disallow this.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=733325
Reviewed-by: Christian Persch <chpe@gnome.org>
9 years agoregex test: improve diagnostics for some failures
Simon McVittie [Sun, 20 Jul 2014 18:33:17 +0000 (19:33 +0100)]
regex test: improve diagnostics for some failures

These fail with system PCRE 8.35, but the improved diagnostics are
generic.

Reviewed-by: Christian Persch <chpe@gnome.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=733325

9 years agogsignal: Mark the return value of g_signal_emitv() as (inout) (optional)
Philip Withnall [Mon, 30 Jun 2014 14:57:28 +0000 (15:57 +0100)]
gsignal: Mark the return value of g_signal_emitv() as (inout) (optional)

https://bugzilla.gnome.org/show_bug.cgi?id=719966

9 years agoUpdated Czech translation
Marek Černocký [Sat, 25 Apr 2015 10:41:09 +0000 (12:41 +0200)]
Updated Czech translation

9 years agoUpdated Icelandic translation
Sveinn í Felli [Fri, 24 Apr 2015 14:36:02 +0000 (14:36 +0000)]
Updated Icelandic translation

9 years agoFix the thumbnail-verification Test
Chun-wei Fan [Wed, 14 May 2014 08:02:35 +0000 (16:02 +0800)]
Fix the thumbnail-verification Test

The third parameter of the thumnail_verify() function had been updated to
const GLocalFileStat, so update the thumbnail-verification test likewise
so that the test works properly on all supported platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=711547

9 years agoapp info: tweak default application algorithm
Ryan Lortie [Thu, 2 Apr 2015 21:17:35 +0000 (17:17 -0400)]
app info: tweak default application algorithm

Always run the full algorithm for a given mime type before considering
fallback types.

This includes considering installed applications capable of handling a
particular mimetype, even if such an app is not explicitly marked as
default, and there is a default app for a less-specific type.

Specifically, this often helps with cases of installing apps that can
handle a particular subtype of text/plain.  We want to take those apps
in preference to a generic text editor, even if that editor is listed as
the default for text/plain and there is no default listed for the more
specific type.

Because of the more holistic approach taken by the algorithm, it is now
more complicated, but it also means that we can do more work while
holding the lock.  In turn, that lets us avoid duplicating some strings,
which is nice.

https://bugzilla.gnome.org/show_bug.cgi?id=744282

9 years agobuild/Makefile-newvs.am: Fix %.vcxproj Rule
Chun-wei Fan [Wed, 22 Apr 2015 08:36:13 +0000 (16:36 +0800)]
build/Makefile-newvs.am: Fix %.vcxproj Rule

The if-else statement added in commit 9bc3ae9 was missing a '\' after the
'else', causing 'make dist/distcheck' to break with "unexpected
end-of-file" errors.

Fix this-didn't notice this when reviewing that patch.  My fault. :|

9 years agogdbusmessage: Fix a minor memory leak on an error path
Philip Withnall [Tue, 21 Apr 2015 22:57:17 +0000 (23:57 +0100)]
gdbusmessage: Fix a minor memory leak on an error path

If g_dbus_message_to_blob() fails at all, it will leak its mbuf. Spotted
by running the gdbus-serialization test under Valgrind — so there is a
justification for leak-free tests after all!

9 years agogvariant-parser: Clarify g_variant_parse() returns a non-floating ref
Philip Withnall [Tue, 21 Apr 2015 22:56:10 +0000 (23:56 +0100)]
gvariant-parser: Clarify g_variant_parse() returns a non-floating ref

Unlike, say, g_variant_new(), which returns a floating reference.
g_variant_parse() returns a non-floating one, so must always have
g_variant_unref() called on the result.

9 years agotests: Fix various minor memory leaks in gdbus-serialization
Philip Withnall [Tue, 21 Apr 2015 22:55:49 +0000 (23:55 +0100)]
tests: Fix various minor memory leaks in gdbus-serialization

9 years agogdbus: fix out-of-bound array access
Marc-André Lureau [Fri, 6 Mar 2015 14:22:33 +0000 (15:22 +0100)]
gdbus: fix out-of-bound array access

In path_rule_matches(), the given paths may be of 0-length. Do not
access memory before the array in those case. This is for example
triggered by:

test_match_rule (con, G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH, "/", "", FALSE);

in test_connection_signal_match_rules().

This bug was found thanks to GCC AddressSanitizer.

https://bugzilla.gnome.org/show_bug.cgi?id=745745

9 years agoMakefile-newvs: some .vcxproj.filters files are in builddir, some in srcdir
Simon McVittie [Mon, 20 Apr 2015 13:54:28 +0000 (14:54 +0100)]
Makefile-newvs: some .vcxproj.filters files are in builddir, some in srcdir

Without this change, out-of-tree distcheck doesn't get very far.

Similarly, allow *.vcxproj, *.props to be in either the builddir or
the srcdir.

Finally, since I'm touching these lines anyway, eliminate some
useless uses of cat: "cat x | sed 's/foo/bar/' > y" is
equivalent to "sed 's/foo/bar/' < x > y".

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=748176
Reviewed-by: Chun-wei Fan <fanchunwei@src.gnome.org>
9 years agogsocketconnection: Fix copy-pasto in documentation
Arun Raghavan [Fri, 17 Apr 2015 04:30:50 +0000 (10:00 +0530)]
gsocketconnection: Fix copy-pasto in documentation

https://bugzilla.gnome.org/show_bug.cgi?id=748019

9 years agoDistribute summary-xmllang-and-attrs.gschema.xml in tarballs
Simon McVittie [Mon, 20 Apr 2015 11:15:42 +0000 (12:15 +0100)]
Distribute summary-xmllang-and-attrs.gschema.xml in tarballs

This is needed for "make distcheck".

Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=748177

9 years agobuild/Makfile-newvs.am: Use Pattern Rules
Chun-wei Fan [Fri, 17 Apr 2015 05:59:28 +0000 (13:59 +0800)]
build/Makfile-newvs.am: Use Pattern Rules

Make use of pattern rules when generating the Visual Studio 2012/2013
Projects from the Visual Studio 2010 projects, which will help to clean up
the file and also avoid problems when running items like 'make -jN dist'.

9 years agoW32: use 64-bit stat for localfile size calculation
Руслан Ижбулатов [Mon, 4 Aug 2014 12:39:08 +0000 (12:39 +0000)]
W32: use 64-bit stat for localfile size calculation

https://bugzilla.gnome.org/show_bug.cgi?id=728669

9 years agoRemove UTF-8 quotation marks
Behdad Esfahbod [Mon, 13 Apr 2015 19:30:16 +0000 (12:30 -0700)]
Remove UTF-8 quotation marks

https://bugzilla.gnome.org/show_bug.cgi?id=747772

9 years agogdbus: Validate the --dest argument
Matthias Clasen [Thu, 9 Apr 2015 02:07:26 +0000 (22:07 -0400)]
gdbus: Validate the --dest argument

Passing an nonsense string for the --dest argument can lead
to a segfault of gdbus. Thats not nice, so use our existing
validation function for bus names here.

https://bugzilla.gnome.org/show_bug.cgi?id=747541

9 years agogsettings: add test for repeated <summary> errors
Ryan Lortie [Thu, 9 Apr 2015 02:11:27 +0000 (22:11 -0400)]
gsettings: add test for repeated <summary> errors

Make sure error handling on repeated <summary> and <description> is
being done properly, not resulting in glib-compile-schemas throwing a
critical.

https://bugzilla.gnome.org/show_bug.cgi?id=747542

9 years agogsettings: fix schema compiler error handling
Ryan Lortie [Thu, 9 Apr 2015 02:08:13 +0000 (22:08 -0400)]
gsettings: fix schema compiler error handling

Fix a couple of issues in error handling in glib-compile-schemas.

The first problem is that, in case of repeated <summary> or
<description> tags we were still allocating a GString which was never
being freed (due to the throwing of the error resulting in immediate
termination of the parse).

The second problem is that if the repeated <summary> tag also had
attributes, we would attempt to set the GError twice.

https://bugzilla.gnome.org/show_bug.cgi?id=747542

9 years agogsettings: stay compatible with installed schemas
Ryan Lortie [Thu, 9 Apr 2015 01:55:58 +0000 (21:55 -0400)]
gsettings: stay compatible with installed schemas

Bug 747209 introduced an error when multiple <summary> or <description>
tags are found for a single key in a GSettings schema.  This check
should have been present from the start, but it was left out because the
schema compiler doesn't include these items in the cache file.  Even
still -- part of the schema compiler's job is validation, and it should
be enforcing proper syntax here.

Repeated <summary> and <description> tags are a semi-common problem when
intltool has been misconfigured in the build system of a package, but
it's possible to imagine mistakes being made by hand as well.

The idea is that these problems would be caught during the build of a
package and maintainers would be forced to fix their build systems.

An unintended side-effect of this change, however, is that the schema
compiler started ignoring already-installed schemas that contained these
problems, when rebuilding the cache.  This means that the installation
of _any_ application would cause the regeneration of the entire cache,
with these already-installed applications being excluded.  Without the
schema in the cache, the application would crash on next startup.

The validation check in the gsettings m4 macro passes --strict to the
compiler, which is not used when rebuilding the cache after
installation.  Pass this flag down into the parser and only throw the
error in case --strict was given.  This will result in the (desired)
build failure without also causing already-installed apps to stop
functioning.

This means that we will not get even a warning about the invalid schema
file in the already-installed case, but that's fine.  There is no sense
spamming the user with these messages when they are already quite fatal
for the developer at build time.

https://bugzilla.gnome.org/show_bug.cgi?id=747472

9 years agodocs: Document the --strict option of glib-compile-schemas
Matthias Clasen [Wed, 8 Apr 2015 10:38:16 +0000 (06:38 -0400)]
docs: Document the --strict option of glib-compile-schemas

Curiously, this option has managed to remain undocumented for
5 years.

9 years agoMention the glib-compile-schemas change in NEWS
Matthias Clasen [Tue, 7 Apr 2015 20:20:00 +0000 (16:20 -0400)]
Mention the glib-compile-schemas change in NEWS

9 years agodocs: Fix documentation for 95d300eac58e
Ross Lagerwall [Tue, 7 Apr 2015 17:22:58 +0000 (18:22 +0100)]
docs: Fix documentation for 95d300eac58e

9 years agogatomic: Add missing new line in API doc comment
Christophe Fergeau [Sat, 21 Feb 2015 12:34:36 +0000 (13:34 +0100)]
gatomic: Add missing new line in API doc comment

This causes an overlong line, and a spurious '*' in the generated
documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=747363

9 years agogio/gdbusproxy.c: Include gasyncresult.h
Chun-wei Fan [Tue, 7 Apr 2015 07:02:22 +0000 (15:02 +0800)]
gio/gdbusproxy.c: Include gasyncresult.h

Commit f10b655 removed the inclusion of gasyncresult.h from gdbusproxy.c,
but gdbusproxy.c uses g_async_result_get_source_object(), which caused a
build warning/error.  Fix that.

9 years agogdbus: fix deadlock on message cancel/timeout
Dan Winship [Mon, 6 Apr 2015 14:09:04 +0000 (10:09 -0400)]
gdbus: fix deadlock on message cancel/timeout

The gdbus GTask port introduced a deadlock because some code had been
using g_simple_async_result_complete_in_idle() to ensure that the
callback didn't run until after a mutex was unlocked, but in the gtask
version, the callback was being run immediately. Fix it to drop the
mutex before calling g_task_return*(). Also, tweak
tests/gdbus-connection to test this.

https://bugzilla.gnome.org/show_bug.cgi?id=747349

9 years agotls: Add support for copying session data
Ross Lagerwall [Thu, 26 Feb 2015 22:24:36 +0000 (22:24 +0000)]
tls: Add support for copying session data

Add support for copying session data between client connections.
This is needed for implementing FTP over SSL. Most servers use a separate
session for each control connection and enforce sharing of each control
connection's session between the related data connection.

Copying session data between two connections is needed for two reasons:
1) The data connection runs on a separate port and so has a different
server_identity which means it would not normally share the session with
the control connection using the session caching currently implemented.
2) It is typical to have multiple control connections, each of which
uses a different session with the same server_identity, so only one of
these sessions gets stored in the cache. If a data connection is opened,
(ignoring the port issue) it may try and reuse the wrong control
connection's session, and fail.

This operation is conceptually the same as OpenSSL's SSL_copy_session_id
operation.

https://bugzilla.gnome.org/show_bug.cgi?id=745255

9 years agoMake sure GStatBuf is typedefed correctly
Руслан Ижбулатов [Mon, 21 Apr 2014 14:52:35 +0000 (14:52 +0000)]
Make sure GStatBuf is typedefed correctly

https://bugzilla.gnome.org/show_bug.cgi?id=728663

9 years agoAdd an event signal to GSocketListener
Paolo Borelli [Thu, 9 Oct 2014 13:54:43 +0000 (15:54 +0200)]
Add an event signal to GSocketListener

This allows the caller to know when a socket has been bound so that
it can for instance set the SO_SENDBUF and SO_RECVBUF socket options
before listen is called

https://bugzilla.gnome.org/show_bug.cgi?id=738207

9 years agogio: deprecate GSimpleAsyncResult
Dan Winship [Tue, 17 Apr 2012 14:38:37 +0000 (10:38 -0400)]
gio: deprecate GSimpleAsyncResult

GTask has been around for a long time now, everything in GLib is using
it, and the run-in-thread deadlock problems should be fixed now.

https://bugzilla.gnome.org/show_bug.cgi?id=661767

9 years agogio: (belatedly) port gdbus from GSimpleAsyncResult to GTask
Dan Winship [Thu, 2 Aug 2012 19:46:32 +0000 (15:46 -0400)]
gio: (belatedly) port gdbus from GSimpleAsyncResult to GTask

https://bugzilla.gnome.org/show_bug.cgi?id=661767

9 years agotests: clean up / ignore some more generated files
Dan Winship [Sat, 4 Apr 2015 14:00:39 +0000 (10:00 -0400)]
tests: clean up / ignore some more generated files

9 years agogtask: remove hardcoded GTask thread-pool size
Dan Winship [Mon, 9 Mar 2015 20:33:16 +0000 (16:33 -0400)]
gtask: remove hardcoded GTask thread-pool size

GTask used a 10-thread thread pool for g_task_run_in_thread() /
g_task_run_in_thread_sync(), but this ran into problems when task
threads blocked waiting for another g_task_run_in_thread_sync()
operation to complete. Previously there was a workaround for this, by
bumping up the thread limit when that case was detected, but deadlocks
could still happen if there were non-GTask threads involved. (Eg, task
A sends a message to thread X and waits for a response, but thread X
needs to complete task B in a thread before returning the response to
task A.)

So, allow GTask's thread pool to be expanded dynamically, by watching
it from the glib worker thread, and growing it (at an
exponentially-decreasing rate) if too much time passes without any
tasks completing. This should solve the deadlocking problems without
causing sudden breakage in apps that assume they can queue huge
numbers of tasks at once without consequences.

https://bugzilla.gnome.org/show_bug.cgi?id=687223

9 years agoglib-compile-schema: Don't accept duplicate docs
Matthias Clasen [Wed, 1 Apr 2015 22:55:54 +0000 (18:55 -0400)]
glib-compile-schema: Don't accept duplicate docs

This schema compiler was completely ignoring <summary> and
<description> tags. Unfortunately, there are modules out there
who merge translations for these back in, with xml:lang. And
this is giving dconf-editor a hard time. Since this is not
how translations of schemas are meant to be done, just
reject such schema files.

Also add tests exercising the new error handling.

https://bugzilla.gnome.org/show_bug.cgi?id=747209

9 years agoUpdated Russian translation
Stas Solovey [Mon, 30 Mar 2015 21:45:26 +0000 (21:45 +0000)]
Updated Russian translation

9 years agoMake glib-compile-resources a little smarter
alex94puchades [Wed, 25 Mar 2015 14:26:07 +0000 (15:26 +0100)]
Make glib-compile-resources a little smarter

glib-compile-resources was guessing a filename ending
in .c when generating sources, but did not do the same
for headers. Fix it so it generates a .h file when
guessing the filename for headers.

https://bugzilla.gnome.org/show_bug.cgi?id=746753

9 years agoClarify a confusing string
Matthias Clasen [Sun, 29 Mar 2015 15:41:00 +0000 (11:41 -0400)]
Clarify a confusing string

Relative was repeated twice here, when clearly what was meant is
relative or absolute. Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=726447

9 years agoinotify: fix move event matching accounting
Ryan Lortie [Thu, 26 Mar 2015 18:49:26 +0000 (14:49 -0400)]
inotify: fix move event matching accounting

The hash table stores the list of unmatched IN_MOVE_FROM events, but we
were removing entries from it when popping IN_MOVE_TO events.

Fix that up to correct a crash in nautilus due to the assertion failure
below.

https://bugzilla.gnome.org/show_bug.cgi?id=746749

9 years agofile monitors: fix a typo
Ryan Lortie [Thu, 26 Mar 2015 03:08:38 +0000 (23:08 -0400)]
file monitors: fix a typo

Due to a typo, a rename reported via a pair of delete/create events (due
to the watcher not giving the flag for moves to be paired) was
accidentally reported as being created with the old name instead of the
new name.

Fix that.

9 years agoGListModel: roll back use of type redefinition
Ryan Lortie [Wed, 25 Mar 2015 13:29:49 +0000 (09:29 -0400)]
GListModel: roll back use of type redefinition

We declare the typedefs for GListModel and GListStore in giotypes.h, as
a matter of convention.  This is not actually required, since the
typedef is emitted as part of the G_DECLARE_* macros.

The giotypes.h approach is only used to avoid cyclic dependencies
between headers, which is not a problem in this case.

Type redefinition is a C11 feature, and although it was around in some
compilers before then, gcc 4.2.1 (from 2007) is apparently still in wide
use, being the default compiler for OpenBSD.

Eventually, we will probably hit a case where we actually need to
redefine a type, but since we're not there yet, let's back off a bit.

9 years agoUpdate Czech translation
Petr Kovar [Wed, 25 Mar 2015 12:01:47 +0000 (13:01 +0100)]
Update Czech translation

9 years agoGClosure: add valgrind hints
Ryan Lortie [Sun, 9 Nov 2014 16:22:42 +0000 (11:22 -0500)]
GClosure: add valgrind hints

GClosure has been in the "allocate area before the pointer" game since
before we did this with GTypeInstance.  At the time that this was done
for GClosure, we didn't have valgrind.h in GLib.

Now that we do, we should add similar valgrind hints as the ones we did
for GTypeInstance.  This substantially reduces reports of "possibly
lost" on pretty much any program that makes use of signals.

https://bugzilla.gnome.org/show_bug.cgi?id=739850

9 years agoFix the build
Matthias Clasen [Sun, 22 Mar 2015 19:05:13 +0000 (15:05 -0400)]
Fix the build

The world would be a better place if gcc had __has_feature(), too.

9 years agoAccount for clangs lack of __alloc_size__
Matthias Clasen [Sun, 22 Mar 2015 18:18:36 +0000 (14:18 -0400)]
Account for clangs lack of __alloc_size__

clang's emulation of gcc 4.3 is not perfect, despite its
pretending that it is.

https://bugzilla.gnome.org/show_bug.cgi?id=745821

9 years agoUpdated Turkish translation
Muhammet Kara [Sun, 22 Mar 2015 00:17:31 +0000 (00:17 +0000)]
Updated Turkish translation

9 years agogsocket: Document FD ownership with g_socket_new_from_fd()
Philip Withnall [Thu, 15 May 2014 10:44:18 +0000 (11:44 +0100)]
gsocket: Document FD ownership with g_socket_new_from_fd()

https://bugzilla.gnome.org/show_bug.cgi?id=730188

9 years agoUpdated Danish translation
Ask H. Larsen [Sat, 21 Mar 2015 15:24:42 +0000 (16:24 +0100)]
Updated Danish translation

9 years agoUpdated German translation
Christian Kirbach [Sat, 21 Mar 2015 15:22:09 +0000 (15:22 +0000)]
Updated German translation

9 years agoUpdated Basque language
Inaki Larranaga Murgoitio [Sat, 21 Mar 2015 15:07:05 +0000 (16:07 +0100)]
Updated Basque language

9 years agogversionmacros: add 2.46 version macros
Dan Winship [Fri, 6 Mar 2015 18:43:37 +0000 (13:43 -0500)]
gversionmacros: add 2.46 version macros

9 years agogmain: Save errno when handling unix signals
Ryan Lortie [Fri, 19 Dec 2014 22:05:59 +0000 (17:05 -0500)]
gmain: Save errno when handling unix signals

Our signal handler calls write() on a pipe or an eventfd in order to
deliver the notification.  It's unlikely, but this could fail, setting
errno.  We even check the case that it fails with EINTR.

If it does set errno, then it has potentially blown away the value or
errno that the preempted code cared about (ie: if the signal arrived
shortly after a system call but before errno was checked).

Wrap the handler with code to save errno.

https://bugzilla.gnome.org/show_bug.cgi?id=741791

9 years agoWin32: Port Directory Monitoring to New GLocalFileMonitor
Chun-wei Fan [Thu, 12 Mar 2015 11:20:30 +0000 (19:20 +0800)]
Win32: Port Directory Monitoring to New GLocalFileMonitor

This WIP patch moves the Windows Directory Monitoring code to the new
GLocalFileMonitor mechanism, and adds file monitoring in the process.

Progress from previous patch:
-File renames are now properly supported, but G_FILE_MONITOR_EVENT_MOVED_IN
 and G_FILE_MONITOR_EVENT_MOVED_OUT needs to be investigated, as
 ReadDirectoryChangesW() seems to send FILE_ACTION_REMOVED when a file is
 moved out of a directory.
-Events are handled for both the long and short (8.3) variants of the
 filenames, and files monitored will report changes when it is changed
 via its short or long filenames.

Things to be done:
-Perhaps find out about attribute changes in files in a monitored
 directory; if a file is monitored, attribute changes are correctly
 handled.
-Investigate on G_FILE_MONITOR_EVENT_MOVED_OUT,
 G_FILE_MONITOR_EVENT_MOVED_IN, G_FILE_MONITOR_EVENT_PRE_UNMOUNT,
 G_FILE_MONITOR_EVENT_UNMOUNTED.
-Investigate on the "boredom" algoritm, and see how we can do it on
 Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=730116

9 years agofile monitors: rewrite FAM file monitor
Ryan Lortie [Sat, 17 Jan 2015 16:11:22 +0000 (11:11 -0500)]
file monitors: rewrite FAM file monitor

Completely rewrite the FAM file monitor.  Major changes:

 - now runs in the worker thread

 - dispatches events in a threadsafe way via GFileMonitorSource

 - uses unix fd source instead of a GIOChannel

 - is now simple enough to fit into one short file

9 years agofen: remove Solaris file monitor support
Ryan Lortie [Sat, 17 Jan 2015 01:25:38 +0000 (20:25 -0500)]
fen: remove Solaris file monitor support

This code is unmaintained and we have no way to port it to the new file
monitoring API.

9 years agokqueue backend: port to new GLocalFileMonitor API
Ryan Lortie [Fri, 16 Jan 2015 23:51:34 +0000 (18:51 -0500)]
kqueue backend: port to new GLocalFileMonitor API

This is the bare minimal effort.  This seems not to crash immediately,
but it definitely needs some better testing.

The backend is not in good shape.  It could use some serious work.

9 years agoGPollFileMonitor: use thread default main context
Ryan Lortie [Fri, 16 Jan 2015 21:41:21 +0000 (16:41 -0500)]
GPollFileMonitor: use thread default main context

Attach the GPollFileMonitor to the thread default main context instead
of the global default.

This matches the behaviour of the other file monitors.

9 years agoinotify: implement "boredom" algorithm
Ryan Lortie [Thu, 15 Jan 2015 21:38:22 +0000 (16:38 -0500)]
inotify: implement "boredom" algorithm

Use the "interesting" value from g_file_monitor_source_handle_event() to
decide if we're currently being flooded by a stream of boring events.

The main case here is when one or more files is being written to and the
change events are all being rate-limited in the GFileMonitor frontends.

In that case, we become "bored" with the event stream and add a backoff
timeout.  In the case that it is exactly one large file being written
(which is the common case) then leaving the event in the queue also lets
the kernel perform merging on it, so when we wake up, we will only see
the one event.  Even in the case that the kernel is unable to perform
merging, the context switch overhead will be vastly reduced.

In testing, this cuts down on the number of wake ups during a large file
copy, by a couple orders of magnitude (ie: less than 1% of the number of
wake ups).

9 years agoGFileMonitorSource: return "interesting" value
Ryan Lortie [Thu, 15 Jan 2015 20:39:43 +0000 (15:39 -0500)]
GFileMonitorSource: return "interesting" value

Return an "interesting" boolean from the event handler function on
GFileMonitorSource.

An event was "interesting" if it will result in a signal actually being
dispatched to the user.  It is "uninteresting" if it only hit an
already-dirty rate limiter.

We will use this information to do some backing off in the backends when
faced with a flood of uninteresting events.

9 years agoinotify: send CHANGES_DONE when new files 'appear'
Ryan Lortie [Thu, 15 Jan 2015 16:08:35 +0000 (11:08 -0500)]
inotify: send CHANGES_DONE when new files 'appear'

We generally assume that an IN_CREATE event is the start of a series of
events in which another process is doing this:

  fd = creat (...)         -> IN_CREATE
  write (fd, ..)           -> IN_MODIFY
  write (fd, ..)           -> IN_MODIFY
  close (fd)               -> IN_CLOSE_WRITE

and as such, we use the CHANGES_DONE_HINT event after CREATED in order
to show when this sequence of events has completed (ie: when we receive
IN_CLOSE_WRITE when the user closes the file).

Renaming a file into place is handled by IN_MOVED_FROM so we don't have
to worry about that.

There are many other cases, however, where a new file 'appears' in a
directory in its completed form already, and the kernel reports
IN_CREATE.  Examples include mkdir, mknod, and the creation of
hardlinks.  In these cases, there is no corresponding IN_CLOSE_WRITE
event and the CHANGES_DONE_HINT will have to be emitted by an arbitrary
timeout.

Try to detect some of these cases and report CHANGES_DONE_HINT
immediately.

This is not perfect.  There are some cases that will not be reliably
detected.  An example is if the user makes a hardlink and then
immediately deletes the original (before we can stat the new file).
Another example is if the user creates a file with O_TMPFILE.  In both
of these cases, CHANGES_DONE_HINT will still eventually be delivered via
the timeout.

9 years agosubstantially rework file monitors
Ryan Lortie [Mon, 12 Jan 2015 19:59:35 +0000 (14:59 -0500)]
substantially rework file monitors

Remove all event merging and dispatch logic from GFileMonitor.  The only
implementation of GFileMonitor outside of glib is in gvfs and it already
does these things properly.

Get rid of GLocalDirectoryMonitor.  We will use a single class,
GLocalFileMonitor, for both directory and file monitoring.  This will
prevent every single backend from having to create two objects
separately (eg: ginotifydirectorymonitor.c and ginotifyfilemonitor.c).

Introduce GFileMonitorSource as a thread-safe cross-context dispatch
mechanism.  Put it in GLocalFileMonitor.  All backends will be expected
to dispatch via the source and not touch the GFileMonitor object at all
from the worker thread.

Remove all construct properties from GLocalFileMonitor and remove the
"context" construct property from GFileMonitor.  All backends must now
get the information about what file to monitor from the ->start() call
which is mandatory to implement.

Remove the implementation of rate limiting in GFileMonitor and add an
implementation in GLocalFileMonitor.  gvfs never did anything with this
anyway, but if it wanted to, it would have to implement it for itself.
This was done in order to get the rate_limit field into the
GFileMonitorSource so that it could be safely accessed from the worker
thread.

Expose g_local_file_is_remote() internally for NFS detection.

With the "is_remote" functionality exposed, we can now move all
functions for creating local file monitors to a proper location in
glocalfilemonitor.c

Port the inotify backend to adjust to the changes above.  None of the
other backends are ported yet.  Those will come in future commits.

9 years agoinotify: rewrite inotify-kernel
Ryan Lortie [Fri, 6 Mar 2015 02:28:29 +0000 (21:28 -0500)]
inotify: rewrite inotify-kernel

Remove the hardwired 1 second event queue logic from inotify-kernel and
replace it with something vastly less complicated.

Events are now reported as soon as is possible instead of after a
delay.

We still must delay IN_MOVED_FROM events in order to look for the
matching IN_MOVED_TO events, and since we want to report events in order
this means that events behind those events can also be delayed.  We
limit ourselves, however:

 - no more than 100 events can be delayed at a time

 - no event can be delayed by more than 10ms

https://bugzilla.gnome.org/show_bug.cgi?id=627285

9 years agoGLocalFile: add _new_from_dirname_and_basename
Ryan Lortie [Fri, 6 Mar 2015 02:05:06 +0000 (21:05 -0500)]
GLocalFile: add _new_from_dirname_and_basename

Add a new internal constructor for GLocalFile (which itself is private).

This new constructor allows creating a GLocalFile from a dirname and a
basename, assuming that the dirname is already in canonical form and the
basename is a regular basename.

This will be used for creating GLocalFile instances from the file
monitoring code (for signal emissions).

9 years agoFinnish translation update
Jiri Grönroos [Fri, 20 Mar 2015 15:43:30 +0000 (17:43 +0200)]
Finnish translation update

9 years agoUpdated Norwegian bokmål translation.
Kjartan Maraas [Thu, 19 Mar 2015 20:16:10 +0000 (21:16 +0100)]
Updated Norwegian bokmål translation.

9 years agoUpdate .gitignore
Jasper St. Pierre [Wed, 18 Mar 2015 21:28:07 +0000 (14:28 -0700)]
Update .gitignore

9 years agoUpdated Hebrew translation
Yosef Or Boczko [Tue, 17 Mar 2015 10:27:19 +0000 (12:27 +0200)]
Updated Hebrew translation

9 years agobump version (to GLib 2.45.0)
Ryan Lortie [Mon, 16 Mar 2015 19:22:03 +0000 (15:22 -0400)]
bump version (to GLib 2.45.0)

9 years agoGLib 2.43.92 2.43.92
Ryan Lortie [Mon, 16 Mar 2015 18:25:53 +0000 (14:25 -0400)]
GLib 2.43.92

9 years agoUpdated Russian translation
Stas Solovey [Mon, 16 Mar 2015 10:01:52 +0000 (10:01 +0000)]
Updated Russian translation

9 years agoUpdated Slovenian translation
Matej Urbančič [Sun, 15 Mar 2015 13:31:13 +0000 (14:31 +0100)]
Updated Slovenian translation

9 years agoUpdated French translation
Claude Paroz [Sat, 14 Mar 2015 08:34:57 +0000 (09:34 +0100)]
Updated French translation

9 years agoTranslation pa updated for Gnome
A S Alam [Sat, 14 Mar 2015 03:50:42 +0000 (22:50 -0500)]
Translation pa updated for Gnome

9 years agoContextSpecificGroup: some fixups
Ryan Lortie [Fri, 13 Mar 2015 21:34:57 +0000 (17:34 -0400)]
ContextSpecificGroup: some fixups

For all of the effort spent ensuring that this algorithm would be
correctly threadsafe, I messed up the order of operations within a
single thread when porting to the new approach.

Fix that up.

Also: fix some overzealous asserting in the testcases.  Since shutdown
is now lazy, we can never surely say !is_running at any particular point
in time.

9 years agoUpdated Bosnian translation
Samir Ribic [Fri, 13 Mar 2015 20:57:49 +0000 (20:57 +0000)]
Updated Bosnian translation

9 years agoUpdated Swedish translation
Sebastian Rasmussen [Fri, 13 Mar 2015 17:16:00 +0000 (17:16 +0000)]
Updated Swedish translation

9 years agogoption: Mention type of G_OPTION_ARG_CALLBACK in documentation
Philip Withnall [Fri, 13 Mar 2015 09:10:01 +0000 (09:10 +0000)]
goption: Mention type of G_OPTION_ARG_CALLBACK in documentation

9 years agothreads: use FUTEX_WAIT_PRIVATE and FUTEX_WAKE_PRIVATE if possible
Tim-Philipp Müller [Fri, 12 Dec 2014 01:38:24 +0000 (01:38 +0000)]
threads: use FUTEX_WAIT_PRIVATE and FUTEX_WAKE_PRIVATE if possible

This avoids some expensive code paths in the kernel, see
http://lwn.net/Articles/229668/

https://bugzilla.gnome.org/show_bug.cgi?id=741442

9 years agodocs: clean up a few glib issues
Ryan Lortie [Thu, 12 Mar 2015 21:24:05 +0000 (17:24 -0400)]
docs: clean up a few glib issues

Fix a few typical problems, and also stop wrapping the inline definition
of g_steal_pointer in parens, since it is not necessary and it confuses
gtk-doc.

9 years agogio docs: remote errant colon from docstring
Ryan Lortie [Thu, 12 Mar 2015 21:01:00 +0000 (17:01 -0400)]
gio docs: remote errant colon from docstring

This does not belong there.

9 years agoConvert remaining uses of 'Rename to:'
Ryan Lortie [Thu, 12 Mar 2015 20:53:18 +0000 (16:53 -0400)]
Convert remaining uses of 'Rename to:'

This was replaced by (rename-to) in 2013 (see bug 676133).

They're also causing gtk-doc trouble, so let's get rid of them.

9 years agodocs: more cleanups for GIO
Ryan Lortie [Thu, 12 Mar 2015 20:43:02 +0000 (16:43 -0400)]
docs: more cleanups for GIO

9 years agoDoc: Fix missing API from GOptionGroup boxing
Xavier Claessens [Wed, 11 Feb 2015 16:27:28 +0000 (11:27 -0500)]
Doc: Fix missing API from GOptionGroup boxing

9 years agoDoc: Mark a few things as private
Xavier Claessens [Thu, 5 Feb 2015 18:10:14 +0000 (13:10 -0500)]
Doc: Mark a few things as private

9 years agoWin32: Move g_win32_check_windows_version() to the correct place in header
Xavier Claessens [Wed, 28 Jan 2015 17:25:10 +0000 (12:25 -0500)]
Win32: Move g_win32_check_windows_version() to the correct place in header

It was added after G_END_DECLS, outside the #ifdef G_PLATFORM_WIN32,
and inside a #ifndef __GTK_DOC_IGNORE__ block. So it was missing from
the doc.

https://bugzilla.gnome.org/show_bug.cgi?id=743661

9 years agoUpdated Latvian translation
Rūdolfs Mazurs [Thu, 12 Mar 2015 19:54:49 +0000 (21:54 +0200)]
Updated Latvian translation

9 years agoUpdated Korean translation
Changwoo Ryu [Wed, 11 Mar 2015 17:51:35 +0000 (02:51 +0900)]
Updated Korean translation

9 years agoUpdated Greek translation
Tom Tryfonidis [Wed, 11 Mar 2015 13:12:14 +0000 (13:12 +0000)]
Updated Greek translation

9 years agoUpdate Catalan translation
Jordi Mas [Tue, 10 Mar 2015 21:44:19 +0000 (17:44 -0400)]
Update Catalan translation

9 years agoUpdated German translation
Benjamin Steinwender [Tue, 10 Mar 2015 20:56:05 +0000 (20:56 +0000)]
Updated German translation

9 years agoUpdated POTFILES.in
Piotr Drąg [Tue, 10 Mar 2015 18:50:30 +0000 (19:50 +0100)]
Updated POTFILES.in

9 years agogtask: Add a GTask:completed property
Philip Withnall [Thu, 21 Aug 2014 18:04:04 +0000 (19:04 +0100)]
gtask: Add a GTask:completed property

This can be used to query whether the task has completed, in the sense
that it has had a result set on it, and has already – or will soon –
invoke its callback function.

Notifications for this property are emitted immediately after the task’s
main callback, in the same main context as that callback. This allows
for multiple bits of code to listen for completion of the GTask, which
opens the door for blocking on cancellation of the GTask and improved
handling of ‘pending’ behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=743636

9 years agoUpdated Bulgarian translation
Alexander Shopov [Tue, 10 Mar 2015 08:35:24 +0000 (10:35 +0200)]
Updated Bulgarian translation

9 years agoUpdated Slovak translation
Dušan Kazik [Mon, 9 Mar 2015 11:48:33 +0000 (11:48 +0000)]
Updated Slovak translation