From 3b3bc070f802491e98f87d9191e7d33fec78dd5a Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 19 Oct 2024 21:32:04 +0300 Subject: : perhaps fixed race conditions and problems when creating and terminating process groups on Win32 * Sometimes already the job assignment failed in CI builds. We now check whether the process is still alive before throwing an error. * We now set the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag. This theoretically shouldn't be necessary when using TerminateJobObject(), but who knows. --- src/error.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/error.h') diff --git a/src/error.h b/src/error.h index 469d957..5ffd434 100644 --- a/src/error.h +++ b/src/error.h @@ -50,6 +50,7 @@ typedef enum { TECO_ERROR_EDITINGLOCALQREG, TECO_ERROR_MEMLIMIT, TECO_ERROR_CLIPBOARD, + TECO_ERROR_WIN32, /** Interrupt current operation */ TECO_ERROR_INTERRUPTED, @@ -138,6 +139,15 @@ teco_error_editinglocalqreg_set(GError **error, const gchar *name, gsize len) "Editing local Q-Register \"%s\" at end of macro call", name_printable); } +#ifdef G_OS_WIN32 +static inline void +teco_error_win32_set(GError **error, const gchar *prefix, gint err) +{ + g_autofree gchar *msg = g_win32_error_message(err); + g_set_error(error, TECO_ERROR, TECO_ERROR_WIN32, "%s: %s", prefix, msg); +} +#endif + static inline void teco_error_interrupted_set(GError **error) { -- cgit v1.2.3