[PATCH phodav 03/13] spice: handle SIGINT properly

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

 



According to [0], g_debug should not be used in a signal handler.
So, to avoid reentrancy, do not print debug message when quit is
called with SIGINT.

[0] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/signal?view=vs-2019

Signed-off-by: Jakub Janků <jjanku@xxxxxxxxxx>
---
 spice/spice-webdavd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index e494692..cdfa73d 100644
--- a/spice/spice-webdavd.c
+++ b/spice/spice-webdavd.c
@@ -237,7 +237,8 @@ static void mdns_unregister_service (void);
 static void
 quit (int sig)
 {
-  g_debug ("quit %d", sig);
+  if (sig != SIGINT)
+    g_debug ("quit %d", sig);
 
   if (sig == SIGINT || sig == SIGTERM)
       quit_service = TRUE;
-- 
2.21.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]