[libosinfo PATCH v3 4/7] 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 8a7642f..60df191 100644
--- a/osinfo/osinfo_media.c
+++ b/osinfo/osinfo_media.c
@@ -1295,13 +1295,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);
@@ -1310,7 +1310,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