mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-27 00:25:30 +00:00
trivial: Fix the ctrl+c SIGINT signal handling
This was broken since we started using the no-default GMainContext.
This commit is contained in:
parent
192083479e
commit
6f7ceb9b35
@ -305,6 +305,16 @@ fu_util_sigint_cb (gpointer user_data)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
fu_util_setup_signal_handlers(FuUtilPrivate *priv)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
g_autoptr(GSource) source = g_unix_signal_source_new(SIGINT);
|
||||
g_source_set_callback(source, fu_util_sigint_cb, priv, NULL);
|
||||
g_source_attach(g_steal_pointer(&source), priv->main_ctx);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
fu_util_private_free (FuUtilPrivate *priv)
|
||||
{
|
||||
@ -3261,11 +3271,7 @@ main (int argc, char *argv[])
|
||||
|
||||
/* do stuff on ctrl+c */
|
||||
priv->cancellable = g_cancellable_new ();
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
g_unix_signal_add_full (G_PRIORITY_DEFAULT,
|
||||
SIGINT, fu_util_sigint_cb,
|
||||
priv, NULL);
|
||||
#endif
|
||||
fu_util_setup_signal_handlers(priv);
|
||||
g_signal_connect (priv->cancellable, "cancelled",
|
||||
G_CALLBACK (fu_util_cancelled_cb), priv);
|
||||
|
||||
|
@ -2769,6 +2769,16 @@ fu_util_sigint_cb (gpointer user_data)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
fu_util_setup_signal_handlers(FuUtilPrivate *priv)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
g_autoptr(GSource) source = g_unix_signal_source_new(SIGINT);
|
||||
g_source_set_callback(source, fu_util_sigint_cb, priv, NULL);
|
||||
g_source_attach(g_steal_pointer(&source), priv->main_ctx);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
fu_util_private_free (FuUtilPrivate *priv)
|
||||
{
|
||||
@ -3383,11 +3393,7 @@ main (int argc, char *argv[])
|
||||
|
||||
/* do stuff on ctrl+c */
|
||||
priv->cancellable = g_cancellable_new ();
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
g_unix_signal_add_full (G_PRIORITY_DEFAULT,
|
||||
SIGINT, fu_util_sigint_cb,
|
||||
priv, NULL);
|
||||
#endif
|
||||
fu_util_setup_signal_handlers(priv);
|
||||
|
||||
/* sort by command name */
|
||||
fu_util_cmd_array_sort (cmd_array);
|
||||
|
Loading…
Reference in New Issue
Block a user