[libosinfo PATCH v2 4/8] media: Use GInpuStream directly in on_location_read()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let's do this in order to always deal with a GInputStream directly and
avoid dealing with a GFileInputStream or something else when we start
using libsoup to deal with non-local files.

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 osinfo/osinfo_media.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/osinfo/osinfo_media.c b/osinfo/osinfo_media.c
index 8cd4929..aba3e20 100644
--- a/osinfo/osinfo_media.c
+++ b/osinfo/osinfo_media.c
@@ -1293,13 +1293,13 @@ static void on_location_read(GObject *source,
                              GAsyncResult *res,
                              gpointer user_data)
 {
-    GFileInputStream *stream;
+    GInputStream *stream;
     CreateFromLocationAsyncData *data;
     GError *error = NULL;
 
     data = (CreateFromLocationAsyncData *)user_data;
 
-    stream = g_file_read_finish(G_FILE(source), res, &error);
+    stream = G_INPUT_STREAM(g_file_read_finish(G_FILE(source), res, &error));
     if (error != NULL) {
         g_prefix_error(&error, _("Failed to open file: "));
         g_task_return_error(data->res, error);
@@ -1308,7 +1308,7 @@ static void on_location_read(GObject *source,
         return;
     }
 
-    g_input_stream_skip_async(G_INPUT_STREAM(stream),
+    g_input_stream_skip_async(stream,
                               PVD_OFFSET,
                               g_task_get_priority(data->res),
                               g_task_get_cancellable(data->res),
-- 
2.21.0

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux