[libosinfo PATCH v2 2/6] media: Use better naming for goto labels

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

 



Let's replace EXIT for cleanup and ON_ERROR for error and follow a
normal naming convention for the labels.

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

diff --git a/osinfo/osinfo_media.c b/osinfo/osinfo_media.c
index fd5e622..1ee1fa5 100644
--- a/osinfo/osinfo_media.c
+++ b/osinfo/osinfo_media.c
@@ -745,14 +745,14 @@ static void on_svd_read(GObject *source,
     if (ret < 0) {
         g_prefix_error(&error,
                        _("Failed to read supplementary volume descriptor: "));
-        goto EXIT;
+        goto cleanup;
     }
     if (ret == 0) {
         g_set_error(&error,
                     OSINFO_MEDIA_ERROR,
                     OSINFO_MEDIA_ERROR_NO_SVD,
                     _("Supplementary volume descriptor was truncated"));
-        goto EXIT;
+        goto cleanup;
     }
 
     data->offset += ret;
@@ -777,7 +777,7 @@ static void on_svd_read(GObject *source,
                     OSINFO_MEDIA_ERROR_NOT_BOOTABLE,
                     _("Install media is not bootable"));
 
-        goto EXIT;
+        goto cleanup;
     }
 
     uri = g_file_get_uri(data->file);
@@ -812,7 +812,7 @@ static void on_svd_read(GObject *source,
                                   OSINFO_MEDIA_PROP_VOLUME_SIZE,
                                   vol_size);
 
-EXIT:
+ cleanup:
     if (error != NULL)
         g_task_return_error(data->res, error);
     else
@@ -838,14 +838,14 @@ static void on_pvd_read(GObject *source,
                                      &error);
     if (ret < 0) {
         g_prefix_error(&error, _("Failed to read primary volume descriptor: "));
-        goto ON_ERROR;
+        goto error;
     }
     if (ret == 0) {
         g_set_error(&error,
                     OSINFO_MEDIA_ERROR,
                     OSINFO_MEDIA_ERROR_NO_PVD,
                     _("Primary volume descriptor was truncated"));
-        goto ON_ERROR;
+        goto error;
     }
 
     data->offset += ret;
@@ -878,7 +878,7 @@ static void on_pvd_read(GObject *source,
                     OSINFO_MEDIA_ERROR_INSUFFICIENT_METADATA,
                     _("Insufficient metadata on installation media"));
 
-        goto ON_ERROR;
+        goto error;
     }
 
     data->offset = 0;
@@ -893,7 +893,7 @@ static void on_pvd_read(GObject *source,
                               data);
     return;
 
-ON_ERROR:
+ error:
     g_object_unref(stream);
     g_task_return_error(data->res, error);
     create_from_location_async_data_free(data);
-- 
2.19.1

_______________________________________________
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