Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Bug 543040 – async reading on dummy file will crash on GIO_USE_VFS=local
Browse files Browse the repository at this point in the history
        Bug 543040 – async reading on dummy file will crash on
        GIO_USE_VFS=local

        * gfile.c (open_read_async_thread): Cope with read_fn being
        NULL. Reported by Lin Ma.


svn path=/branches/glib-2-16/; revision=7213
  • Loading branch information
Matthias Clasen committed Jul 20, 2008
1 parent a5ccc1f commit 4e9d167
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gio/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2008-07-19 Matthias Clasen <mclasen@redhat.com>

Merge from trunk:

Bug 543040 – async reading on dummy file will crash on
GIO_USE_VFS=local

* gfile.c (open_read_async_thread): Cope with read_fn being
NULL. Reported by Lin Ma.

2008-07-19 Matthias Clasen <mclasen@redhat.com>

Merge from trunk:
Expand Down
12 changes: 12 additions & 0 deletions gio/gfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -4012,6 +4012,18 @@ open_read_async_thread (GSimpleAsyncResult *res,

iface = G_FILE_GET_IFACE (object);

if (iface->read_fn == NULL)
{
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));

g_simple_async_result_set_from_error (res, error);
g_error_free (error);

return;
}

stream = iface->read_fn (G_FILE (object), cancellable, &error);

if (stream == NULL)
Expand Down

0 comments on commit 4e9d167

Please sign in to comment.