[libmanette] device: Don't throw NXIO file error in *_new() if not a gamepad



commit 4d362ab40d0221d391bf0d64b0519024a8d0a508
Author: vanadiae <vanadiae35 gmail com>
Date:   Sat Oct 17 21:03:34 2020 +0200

    device: Don't throw NXIO file error in *_new() if not a gamepad
    
    NXIO has a specific use case, that is, no such device or address, and
    isn't meant for general-purpose use. Since there isn't any
    G_FILE_ERROR_NOT_A_GAME_CONTROLLER, use G_FILE_ERROR_FAILED which is
    made to be used when no unix error code exists for it.

 src/manette-device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/manette-device.c b/src/manette-device.c
index efeda51..a21c349 100644
--- a/src/manette-device.c
+++ b/src/manette-device.c
@@ -548,7 +548,7 @@ manette_device_new (const gchar  *filename,
   if (!is_game_controller (self->evdev_device)) {
     g_set_error (error,
                  G_FILE_ERROR,
-                 G_FILE_ERROR_NXIO,
+                 G_FILE_ERROR_FAILED,
                  "ā€œ%sā€ is not a game controller.",
                  filename);
 


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