[vte] pty: Don't fail init when passed a cancellable



commit 877d5b298160f02a4caa29b043aa2f24672e8402
Author: Christian Persch <chpe src gnome org>
Date:   Mon Apr 27 20:49:04 2020 +0200

    pty: Don't fail init when passed a cancellable

 src/vtepty.cc | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
---
diff --git a/src/vtepty.cc b/src/vtepty.cc
index 8428b460..ec2a0d28 100644
--- a/src/vtepty.cc
+++ b/src/vtepty.cc
@@ -330,12 +330,6 @@ vte_pty_initable_init (GInitable *initable,
         VtePty *pty = VTE_PTY (initable);
         VtePtyPrivate *priv = pty->priv;
 
-        if (cancellable != NULL) {
-                g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
-                                    "Cancellable initialisation not supported");
-                return FALSE;
-        }
-
         if (priv->foreign_fd != -1) {
                 priv->pty = vte::base::Pty::create_foreign(priv->foreign_fd, priv->flags);
                 priv->foreign_fd = -1;
@@ -350,7 +344,7 @@ vte_pty_initable_init (GInitable *initable,
                 return FALSE;
         }
 
-        return TRUE;
+        return !g_cancellable_set_error_if_cancelled(cancellable, error);
 }
 
 static void


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