[libmanette] device: Throw the full file error code in *_new()



commit 3070e0c2627ef0c708ab0e5f0b562c31ece6525c
Author: vanadiae <vanadiae35 gmail com>
Date:   Sat Oct 17 21:01:18 2020 +0200

    device: Throw the full file error code in *_new()
    
    It doesn't make sense to pass G_FILE_ERROR_FAILED, as this one is only
    meant for when there isn't any existing error code for this file error,
    but here it isn't the case since we have the errno set on error.

 src/manette-device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/manette-device.c b/src/manette-device.c
index af6faf0..efeda51 100644
--- a/src/manette-device.c
+++ b/src/manette-device.c
@@ -525,7 +525,7 @@ manette_device_new (const gchar  *filename,
   if (self->fd < 0) {
     g_set_error (error,
                  G_FILE_ERROR,
-                 G_FILE_ERROR_FAILED,
+                 g_file_error_from_errno (errno),
                  "Unable to open ā€œ%sā€: %s",
                  filename,
                  strerror (errno));
@@ -537,7 +537,7 @@ manette_device_new (const gchar  *filename,
   if (libevdev_set_fd (self->evdev_device, self->fd) < 0) {
     g_set_error (error,
                  G_FILE_ERROR,
-                 G_FILE_ERROR_FAILED,
+                 g_file_error_from_errno (errno),
                  "Evdev is unable to open ā€œ%sā€: %s",
                  filename,
                  strerror (errno));


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