Problem: Timer becomes invalid after fork/exec, :gui gives errors. (Gabriel
Dupras)
Solution: Delete the timer befor forking. (closes #10584)
int exit_status;
pid_t pid = -1;
+#if defined(FEAT_RELTIME) && defined(HAVE_TIMER_CREATE)
+ // a timer is not carried forward
+ delete_timer();
+#endif
+
// Setup a pipe between the child and the parent, so that the parent
// knows when the child has done the setsid() call and is allowed to
// exit.
#endif // USE_XSMP
#if defined(FEAT_RELTIME) || defined(PROTO)
-# if defined(HAVE_TIMER_CREATE)
+# if defined(HAVE_TIMER_CREATE) || defined(PROTO)
/*
* Implement timeout with timer_create() and timer_settime().
*/
return &timeout_flag;
}
+/*
+ * To be used before fork/exec: delete any created timer.
+ */
+ void
+delete_timer(void)
+{
+ if (timer_created)
+ {
+ timer_delete(timer_id);
+ timer_created = FALSE;
+ }
+}
+
# else
/*
void xsmp_close(void);
void stop_timeout(void);
const int *start_timeout(long msec);
+void delete_timer(void);
/* vim: set ft=c : */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 5113,
/**/
5112,
/**/