Skip to content

Commit 3d5db07

Browse files
committed
refactor(src/cli/cli.cc): delay exit in signal
1 parent b28d3aa commit 3d5db07

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/cli/cli.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,21 +795,23 @@ void signalHandler (int signum) {
795795

796796
if (appStatus == -1) {
797797
appStatus = signum;
798-
log("App result: " + std::to_string(signum));
798+
log("App result (signal): " + std::to_string(signum));
799799
}
800800

801801
if (signum == SIGTERM || signum == SIGINT) {
802+
#if SOCKET_RUNTIME_PLATFORM_LINUX
803+
while (wait(NULL) != -1 || errno == EINTR);
804+
#endif
802805
signal(signum, SIG_DFL);
803806
raise(signum);
804807
}
805808

806809
#if SOCKET_RUNTIME_PLATFORM_LINUX
807-
msleep(500);
808810
if (gtk_main_level() > 0) {
809811
g_main_context_invoke(
810812
nullptr,
811813
+[](gpointer userData) -> gboolean {
812-
msleep(16);
814+
msleep(1000);
813815
gtk_main_quit();
814816
return true;
815817
},

0 commit comments

Comments
 (0)