Commit Graph

888 Commits

Author SHA1 Message Date
Thomas Kristensen
ccc815e934 Close the socket event in finalizer instead of in close method
There might be a GSource attached to a GMainContext, about to be removed by a
pending cancellation. Deleting the handle too early will trigger a g_warning in
the "select()" call in GMainContext. Attached patch fixes this by deferring
destruction of WSAEVENT object until GSocket's finalize().

Patch from bug #612702.

Signed-off-by: Tor Lillqvist <tml@iki.fi>
2010-03-14 11:52:30 +02:00
Christian Dywan
1feffa2b99 Add licence headers to gnativevolumemonitor.c/h
Fixes bug #609531
2010-03-13 14:24:04 -05:00
Dan Winship
46999595da GResolver: fix Windows 2000 workaround
Move the <wspiapi.h> include from gwin32resolver.c to
gnetworkingprivate.h, since gthreadedresolver.c needs it too.

https://bugzilla.gnome.org/show_bug.cgi?id=611696
(cherry picked from commit 9a886135c8)
2010-03-13 14:22:54 -05:00
Emilio Pozuelo Monfort
242ccb0258 Test for unexisting files in $TMP and not in $HOME
Some buildd environments have an unwritable $HOME, which makes the
test that looks for an unexisting file there fail. Use $TMP instead,
which should be more reliable.

https://bugzilla.gnome.org/show_bug.cgi?id=610860
(cherry picked from commit a7cc500d38)
2010-03-13 14:22:26 -05:00
Emilio Pozuelo Monfort
bc8a748291 Don't fail a couple of tests when running as root
root can access and write to a directory when it doesn't have
exec and write permissions respectively. So expect the tests that
check that to succeed rather than to fail when running as root.

https://bugzilla.gnome.org/show_bug.cgi?id=552912
(cherry picked from commit 202d7d37d6)
2010-03-13 14:22:01 -05:00
Alexander Larsson
afd5dcc026 Keep metadata when files are renamed and trashed
This fixes https://bugzilla.gnome.org/show_bug.cgi?id=609813
(cherry picked from commit 4535683b3f)
2010-03-13 14:21:42 -05:00
Alexander Larsson
e9f6a664bb Set result_uncertain in win32 g_content_type_guess implementation
Fixes bug #609143
(cherry picked from commit b37da7134b)
2010-03-13 14:20:02 -05:00
Tor Lillqvist
4794096123 The SO_KEEPALIVE value seems to actually be a char on Windows
Do still use a BOOL variable, but initialize it to FALSE before the
getsockopt(), and drop the assertion on Windows. Should fix bug
2010-03-12 10:42:43 +02:00
Tor Lillqvist
cff040704e Clarify use of struct stat on Windows 2010-02-04 19:54:50 +02:00
Tor Lillqvist
dce6ec3b7f Put a version info resource also in the gio DLL
Also, distribute gio/gio.rc(.in).
2010-02-04 01:01:57 +02:00
Matthias Clasen
2c0c35af56 Fix the filename roundtrip check
The check was always failing because the code was comparing
the wrong strings. Reported in bug 605977.
(cherry picked from commit f2d8f6287d)
2010-01-06 19:24:45 -05:00
Ryan Lortie
40005647ed GUnixFDMessage: fix a small typo in an extra check
In the deserialise function, GUnixFDMessage was comparing 'level' to
both SOL_SOCKET and SCM_RIGHTS.  It is correct to compare 'type' to
SCM_RIGHTS.  The code passed tests only because:

1) it's a "should always be OK" double-check

2) SOL_SOCKET and SCM_RIGHTS, by chance, both have the value '1' on
   Linux systems.
(cherry picked from commit baf20e0984)
2010-01-06 19:24:36 -05:00
Matthias Clasen
aecd2616c7 Fix a memleak
An early exit in expand_application_parameters forgot to free
a GString. Reported by Steve Grubb.
(cherry picked from commit b00c6d7fb5)
2010-01-06 19:24:28 -05:00
Matthias Clasen
6a8828d40f Fix an off-by-one error
Reported by Steve Grubb.
(cherry picked from commit 6cee86a3ef)
2010-01-06 19:24:20 -05:00
Dan Winship
1a0f372907 Fix UnixWare build by not using "sa_len" as a variable name
https://bugzilla.gnome.org/show_bug.cgi?id=604875
(cherry picked from commit 28d91b5bb6)
2010-01-06 19:22:05 -05:00
Gian Mario Tagliaretti
7e9ad3d746 Remove wrong file imports, only gio/gio.h should be included 2009-12-16 23:38:39 +01:00
Tor Lillqvist
3d546303e8 Check for <wspiapi.h> and use it if present
Should help bug #603527 if glib is built in an environment that has
<wspiapi.h>.
2009-12-14 03:30:39 +02:00
Alexander Larsson
31f928a2c3 Remove default implementation of async filter steam ops
Not only is the default implementation broken (it causes infinite recursion
as seen in bug #603982), but its also worthless. If we just fall back on the
default stream operations we automatically get async version based on
the sync filter stream operations, which is what we want.
(cherry picked from commit 4fbbe190b7)
2009-12-07 22:15:27 +01:00
Ryan Lortie
8a190a155c Bug 598712 - can't detect text file with backspace
looks_like_text(): Allow '\b' to appear in text files.
(cherry picked from commit 48e2a57043)
2009-11-30 23:31:50 -05:00
Ryan Lortie
7a1b265e97 Bug 595138 - GFile not robust with invalid input
Improve handling of g_file_query_default_handler() when called on an
invalid GFile (ie: one created with an invalid URI).
(cherry picked from commit 9681d7e75f)
2009-11-30 23:30:38 -05:00
Alexander Larsson
b0e4df9375 Pass in the right device to vfs->local_file_add_info for symlinks
We used to pass the path for the symlink, but the device of the target
which is wrong and breaks metadata access.

https://bugzilla.gnome.org/show_bug.cgi?id=593809
(cherry picked from commit 2b2195bf68)
2009-11-26 16:07:13 +01:00
Mures Andone
c5b846eb13 Fixed bug 91 (GIO monitoring not working due to bad assert)
https://bugzilla.gnome.org/show_bug.cgi?id=593856
(cherry picked from commit 96f41b6283)
2009-11-26 15:41:58 +01:00
Matthias Clasen
d8fc1528b7 Avoid a warning 2009-10-25 02:53:55 -04:00
Matthias Clasen
36df8c9b9c Don't give up too early when collecting mime types
Since returning exactly one match has special significance, don't
give up matching before we've found at least 2 types. Also, make
sure that we don't return the same mime type more than once.
Bug 541236.
2009-10-25 02:53:54 -04:00
Alexander Larsson
cf622936c4 xdgmime: sort glob hits with larger weight first
Higher weight is more important, so return these first meaning
they will be used as the default.
2009-10-25 02:53:54 -04:00
Tor Lillqvist
a7a480b335 Fix GWin32DirectoryMonitor
GWin32DirectoryMonitor was quite broken, but nobody had apparently
noticed, or at least not filed any bug. Only now with a bleeding edge
GTK+ file chooser does the code get exercised in common programs like
gtk-demo or GIMP, apparently. Bug #598899.
2009-10-23 00:51:48 +03:00
Tomas Bzatek
d5f4e7c656 Documentation fixes 2009-10-13 16:22:16 +02:00
Tor Lillqvist
ae0a220bf3 Construct the gio module directory pathname at run-time on Windows 2009-10-12 00:18:48 +03:00
Alexander Larsson
07ad638adf remove xdgmime test
This is getting diverged from the xdgmime copy and we don't need it here.
2009-10-02 12:55:54 +02:00
Alexander Larsson
c7c0bcef89 xdgmime - Correct the range checks for magic matching 2009-10-02 12:55:54 +02:00
Alexander Larsson
2624e7d6c6 Remove unnecessary includes 2009-10-02 12:55:54 +02:00
Alexander Larsson
e1643fd76d xdgmime - support the new case sensitive flag 2009-10-02 12:55:54 +02:00
Alexander Larsson
7c27df1fee xdgmime - support cache files with minor version 2 2009-10-02 12:55:54 +02:00
Alexander Larsson
ce239a010e Read the new glob2 format with case sensitive flags 2009-10-02 12:55:54 +02:00
Matthias Clasen
e9fe53980b Fix --runtime-libdir option
For stable releases, it needs to take LT_REVISION into account, not
hardcode 0.
2009-09-29 23:08:03 -04:00
Matthias Clasen
6555e0171d Fix mime_info_cache_dir_add_desktop_entries
This function tried to avoid adding duplicate entries, but failed
due to using the wrong search function. See bug 595972.
2009-09-29 20:52:26 -04:00
Matthias Clasen
5fdb169b72 Clarify docs of g_async_result_get_source_object
It returns a new reference. Reported in bug 596748
2009-09-29 20:33:39 -04:00
Alexander Larsson
90e1308809 Avoid critical error in thread check if source is destroyed
The source can be destroyed by the time we complete the result, and
then the g_source_get_context(current_source) call will cause
a critical error. We check for the source being destroyed and avoid
the check in that case.

This means we miss the right-thread check in this case, but thats
merely a helper, so this is not critical.
2009-09-29 11:27:15 +02:00
Alexander Larsson
6f1ce483eb Always report metadata on the path, not symlink target
Metadata are really part of the pathname, not the target file
(as they are stored by pathname, and for many metadata like icon position
etc make not sense using the target data). So, even if nofollow
is not specified we should not follow links for metadata.

Ideally this should be implemented in the metadata extension in gvfs,
but the extension API does not allow this, so we do it in gio.

See https://bugzilla.gnome.org/show_bug.cgi?id=593809
2009-09-28 15:55:44 +02:00
Josselin Mouette
cc4970cf94 Fall back to inotify_init if inotify_init1 does not work
This fixes monitoring failing to work when glib is built on a 2.6.27+
kernel but run on an older one.

http://bugs.debian.org/544354
https://bugzilla.gnome.org/show_bug.cgi?id=593775
2009-09-23 18:39:45 +02:00
Mart Raudsepp
c755a7fd11 gio: Fix some typos in G*AppInfo documentation 2009-09-22 11:22:44 +03:00
Mart Raudsepp
6c061da2a2 gio: Fix a Since tag to actually show up in new API of 2.20 indeces
Typo made in e05426062
2009-09-22 11:22:44 +03:00
Paolo Borelli
80f66b1141 Fix build with srcdir != builddir, bug #594597 2009-09-19 10:22:33 +02:00
Matthias Clasen
53fc10d269 Fix a lot of clang complaints
Mostly dead assignments.
2009-09-18 19:20:06 -04:00
Sjoerd Simons
8667317766 Fix GNetworkAddress skipping addresses when enumerating
g_network_address_address_enumerator_next_finish takes the first item of the
address list and moves the pointer to the next one, so we shouldn't do the same
in g_network_address_address_enumerator_next_async function

Fixes bug #593941
2009-09-11 15:25:34 +01:00
Richard Hughes
cdd04f36ca Make the error const for g_simple_async_result_set_from_error 2009-09-11 15:20:34 +01:00
James Hunt
11477609d1 g_socket_send_message() fails due to invalid sendmsg(2) params.
g_socket_send_message() and g_socket_send_to() fail with ENOBUFS or
EFAULT due to the fact that if no "address" argument is specified to
g_socket_send_message, when g_socket_send_message() calls sendmsg(2),
the 2nd parameter to sendmsg ("const struct msghdr *msg") contains
uninitialized values. The fix is simple - initialize msg.msg_name to
NULL and msg.msg_msg_namelen to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=594759
2009-09-11 08:52:14 -04:00
Alexander Larsson
8af494d987 Avoid reading uninitialized memory
If the statfs call fails, don't look at the result.
2009-09-07 12:50:58 +02:00
Alexander Larsson
06de24f430 Remove warning in g_simple_async_result_complete
This warning hits code that uses GSimpleAsyncResult outside of a
mainloop as a helper object. For instance EggDBus does this.
Since the bugs this warning would fix are pretty easy to spot
and since EggDBus is deployed already we just remove the
"called from outside main loop" warning.

However, we need to keep the "called from wrong context" warning
as that is very helpful when debugging misuse of the new multiple
main context code.
2009-09-07 10:25:14 +02:00
Matthias Clasen
034d516160 Another dead assignment 2009-09-07 03:28:35 -04:00