aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-07-28 09:05:28 -0400
committerGitHub <noreply@github.com>2018-07-28 09:05:28 -0400
commite4b54ac16e52cea9fe7f8385e87033764d36522f (patch)
tree68a12cfe22d349eada6dba59cf6c5c4ef8ec8620 /sway/desktop
parent68d6307aa67f2aab16bfbbf56427666cde964a6c (diff)
parenta4bcddcfdc67ef64edf3737342a99c4e41cae6d4 (diff)
Merge pull request #2368 from RyanDwyer/handle-out-of-fds
Handle out-of-fd situations gracefully for transaction and urgent timers
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/transaction.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index ccda1963..7975366e 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -1,4 +1,5 @@
#define _POSIX_C_SOURCE 200809L
+#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@@ -316,7 +317,14 @@ static void transaction_commit(struct sway_transaction *transaction) {
// Set up a timer which the views must respond within
transaction->timer = wl_event_loop_add_timer(server.wl_event_loop,
handle_timeout, transaction);
- wl_event_source_timer_update(transaction->timer, txn_timeout_ms);
+ if (transaction->timer) {
+ wl_event_source_timer_update(transaction->timer, txn_timeout_ms);
+ } else {
+ wlr_log(WLR_ERROR, "Unable to create transaction timer (%s). "
+ "Some imperfect frames might be rendered.",
+ strerror(errno));
+ handle_timeout(transaction);
+ }
}
// The debug tree shows the pending/live tree. Here is a good place to