diff options
author | 2019-01-24 09:24:02 -0500 | |
---|---|---|
committer | 2019-01-24 09:24:02 -0500 | |
commit | 5f45a4bbc195400dd28e086c2e0e2f479b86e4eb (patch) | |
tree | ba85cc3d475bd57cfe310c5783ebe4e417a17164 | |
parent | Update for swaywm/wlroots#1402 (diff) | |
parent | Use sway_log_errno instead of strerror (diff) | |
download | sway-5f45a4bbc195400dd28e086c2e0e2f479b86e4eb.tar.gz sway-5f45a4bbc195400dd28e086c2e0e2f479b86e4eb.tar.zst sway-5f45a4bbc195400dd28e086c2e0e2f479b86e4eb.zip |
Merge pull request #3509 from ianyfan/log-errno
Use sway_log_errno instead of strerror
-rw-r--r-- | sway/commands/output/background.c | 8 | ||||
-rw-r--r-- | sway/desktop/transaction.c | 7 | ||||
-rw-r--r-- | sway/input/seat.c | 6 |
3 files changed, 9 insertions, 12 deletions
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c index affa04ea..f65904bb 100644 --- a/sway/commands/output/background.c +++ b/sway/commands/output/background.c | |||
@@ -1,5 +1,7 @@ | |||
1 | #define _POSIX_C_SOURCE 200809 | 1 | #define _POSIX_C_SOURCE 200809L |
2 | #include <libgen.h> | 2 | #include <libgen.h> |
3 | #include <stdio.h> | ||
4 | #include <string.h> | ||
3 | #include <strings.h> | 5 | #include <strings.h> |
4 | #include <unistd.h> | 6 | #include <unistd.h> |
5 | #include <wordexp.h> | 7 | #include <wordexp.h> |
@@ -112,8 +114,8 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
112 | 114 | ||
113 | bool can_access = access(src, F_OK) != -1; | 115 | bool can_access = access(src, F_OK) != -1; |
114 | if (!can_access) { | 116 | if (!can_access) { |
115 | sway_log(SWAY_ERROR, "Unable to access background file '%s': %s", | 117 | sway_log_errno(SWAY_ERROR, "Unable to access background file '%s'", |
116 | src, strerror(errno)); | 118 | src); |
117 | config_add_swaynag_warning("Unable to access background file '%s'", | 119 | config_add_swaynag_warning("Unable to access background file '%s'", |
118 | src); | 120 | src); |
119 | free(src); | 121 | free(src); |
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 55cf1c5e..88a9b027 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -1,6 +1,4 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | 1 | #define _POSIX_C_SOURCE 200809L |
2 | #include <errno.h> | ||
3 | #include <limits.h> | ||
4 | #include <stdbool.h> | 2 | #include <stdbool.h> |
5 | #include <stdlib.h> | 3 | #include <stdlib.h> |
6 | #include <string.h> | 4 | #include <string.h> |
@@ -449,9 +447,8 @@ static void transaction_commit(struct sway_transaction *transaction) { | |||
449 | wl_event_source_timer_update(transaction->timer, | 447 | wl_event_source_timer_update(transaction->timer, |
450 | server.txn_timeout_ms); | 448 | server.txn_timeout_ms); |
451 | } else { | 449 | } else { |
452 | sway_log(SWAY_ERROR, "Unable to create transaction timer (%s). " | 450 | sway_log_errno(SWAY_ERROR, "Unable to create transaction timer " |
453 | "Some imperfect frames might be rendered.", | 451 | "(some imperfect frames might be rendered)"); |
454 | strerror(errno)); | ||
455 | transaction->num_waiting = 0; | 452 | transaction->num_waiting = 0; |
456 | } | 453 | } |
457 | } | 454 | } |
diff --git a/sway/input/seat.c b/sway/input/seat.c index fd5eda2d..b6ccd830 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -1,7 +1,6 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | 1 | #define _POSIX_C_SOURCE 200809L |
2 | #include <assert.h> | ||
3 | #include <errno.h> | ||
4 | #include <linux/input-event-codes.h> | 2 | #include <linux/input-event-codes.h> |
3 | #include <string.h> | ||
5 | #include <strings.h> | 4 | #include <strings.h> |
6 | #include <time.h> | 5 | #include <time.h> |
7 | #include <wlr/types/wlr_cursor.h> | 6 | #include <wlr/types/wlr_cursor.h> |
@@ -827,8 +826,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) { | |||
827 | wl_event_source_timer_update(view->urgent_timer, | 826 | wl_event_source_timer_update(view->urgent_timer, |
828 | config->urgent_timeout); | 827 | config->urgent_timeout); |
829 | } else { | 828 | } else { |
830 | sway_log(SWAY_ERROR, "Unable to create urgency timer (%s)", | 829 | sway_log_errno(SWAY_ERROR, "Unable to create urgency timer"); |
831 | strerror(errno)); | ||
832 | handle_urgent_timeout(view); | 830 | handle_urgent_timeout(view); |
833 | } | 831 | } |
834 | } else { | 832 | } else { |