Mercurial > vim
comparison src/os_unix.c @ 29187:87ad2de4fe41 v8.2.5113
patch 8.2.5113: timer becomes invalid after fork/exec, :gui gives errors
Commit: https://github.com/vim/vim/commit/c72e31dfcc013ae840cd7f8899f2430b7f6812c9
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 16 18:47:20 2022 +0100
patch 8.2.5113: timer becomes invalid after fork/exec, :gui gives errors
Problem: Timer becomes invalid after fork/exec, :gui gives errors. (Gabriel
Dupras)
Solution: Delete the timer befor forking. (closes #10584)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 16 Jun 2022 20:00:03 +0200 |
parents | e921ecb232f9 |
children | 0af5fe160e4e |
comparison
equal
deleted
inserted
replaced
29186:b41c197d886e | 29187:87ad2de4fe41 |
---|---|
8245 } | 8245 } |
8246 } | 8246 } |
8247 #endif // USE_XSMP | 8247 #endif // USE_XSMP |
8248 | 8248 |
8249 #if defined(FEAT_RELTIME) || defined(PROTO) | 8249 #if defined(FEAT_RELTIME) || defined(PROTO) |
8250 # if defined(HAVE_TIMER_CREATE) | 8250 # if defined(HAVE_TIMER_CREATE) || defined(PROTO) |
8251 /* | 8251 /* |
8252 * Implement timeout with timer_create() and timer_settime(). | 8252 * Implement timeout with timer_create() and timer_settime(). |
8253 */ | 8253 */ |
8254 static int timeout_flag = FALSE; | 8254 static int timeout_flag = FALSE; |
8255 static timer_t timer_id; | 8255 static timer_t timer_id; |
8329 semsg(_(e_could_not_set_timeout_str), strerror(errno)); | 8329 semsg(_(e_could_not_set_timeout_str), strerror(errno)); |
8330 | 8330 |
8331 return &timeout_flag; | 8331 return &timeout_flag; |
8332 } | 8332 } |
8333 | 8333 |
8334 /* | |
8335 * To be used before fork/exec: delete any created timer. | |
8336 */ | |
8337 void | |
8338 delete_timer(void) | |
8339 { | |
8340 if (timer_created) | |
8341 { | |
8342 timer_delete(timer_id); | |
8343 timer_created = FALSE; | |
8344 } | |
8345 } | |
8346 | |
8334 # else | 8347 # else |
8335 | 8348 |
8336 /* | 8349 /* |
8337 * Implement timeout with setitimer() | 8350 * Implement timeout with setitimer() |
8338 */ | 8351 */ |