summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2017-04-25 23:06:13 +0200
committerChristian Persch <chpe@src.gnome.org>2017-04-25 23:09:01 +0200
commitd2e38f44ec644f94e79f6aa923da5b57601a47df (patch)
tree50ea02c4bb6e48ae013ac25113dafc731ccbddba
parent92da93ab5aa8ee32335dfb14aacd3597823a103f (diff)
downloadvte-d2e38f44ec644f94e79f6aa923da5b57601a47df.tar.gz
pty: spawn: Always fill in the GError on failure
-rw-r--r--src/pty.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pty.cc b/src/pty.cc
index 5006cc72..646a4e06 100644
--- a/src/pty.cc
+++ b/src/pty.cc
@@ -364,8 +364,15 @@ __vte_pty_spawn (VtePty *pty,
GError *err = NULL;
GPollFD pollfd;
- if (cancellable && !g_cancellable_make_pollfd(cancellable, &pollfd))
+ if (cancellable && !g_cancellable_make_pollfd(cancellable, &pollfd)) {
+ vte::util::restore_errno errsv;
+ g_set_error(error,
+ G_IO_ERROR,
+ g_io_error_from_errno(errsv),
+ "Failed to make cancellable pollfd: %s",
+ g_strerror(errsv));
return FALSE;
+ }
spawn_flags |= G_SPAWN_DO_NOT_REAP_CHILD;