aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2019-01-24 11:32:49 +0000
committerIan Fan <ianfan0@gmail.com>2019-01-24 11:33:54 +0000
commit5d6f906bd789f40fb0c58398909cfb39d44d4456 (patch)
treeba85cc3d475bd57cfe310c5783ebe4e417a17164
parent75406bb93b96091d30e52922d0f319530fe65471 (diff)
downloadsway-5d6f906bd789f40fb0c58398909cfb39d44d4456.zip
sway-5d6f906bd789f40fb0c58398909cfb39d44d4456.tar.gz
sway-5d6f906bd789f40fb0c58398909cfb39d44d4456.tar.bz2
Use sway_log_errno instead of strerror
-rw-r--r--sway/commands/output/background.c8
-rw-r--r--sway/desktop/transaction.c7
-rw-r--r--sway/input/seat.c6
3 files changed, 9 insertions, 12 deletions
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c
index affa04e..f65904b 100644
--- a/sway/commands/output/background.c
+++ b/sway/commands/output/background.c
@@ -1,5 +1,7 @@
-#define _POSIX_C_SOURCE 200809
+#define _POSIX_C_SOURCE 200809L
#include <libgen.h>
+#include <stdio.h>
+#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <wordexp.h>
@@ -112,8 +114,8 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
bool can_access = access(src, F_OK) != -1;
if (!can_access) {
- sway_log(SWAY_ERROR, "Unable to access background file '%s': %s",
- src, strerror(errno));
+ sway_log_errno(SWAY_ERROR, "Unable to access background file '%s'",
+ src);
config_add_swaynag_warning("Unable to access background file '%s'",
src);
free(src);
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 55cf1c5..88a9b02 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -1,6 +1,4 @@
#define _POSIX_C_SOURCE 200809L
-#include <errno.h>
-#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@@ -449,9 +447,8 @@ static void transaction_commit(struct sway_transaction *transaction) {
wl_event_source_timer_update(transaction->timer,
server.txn_timeout_ms);
} else {
- sway_log(SWAY_ERROR, "Unable to create transaction timer (%s). "
- "Some imperfect frames might be rendered.",
- strerror(errno));
+ sway_log_errno(SWAY_ERROR, "Unable to create transaction timer "
+ "(some imperfect frames might be rendered)");
transaction->num_waiting = 0;
}
}
diff --git a/sway/input/seat.c b/sway/input/seat.c
index fd5eda2..b6ccd83 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1,7 +1,6 @@
#define _POSIX_C_SOURCE 200809L
-#include <assert.h>
-#include <errno.h>
#include <linux/input-event-codes.h>
+#include <string.h>
#include <strings.h>
#include <time.h>
#include <wlr/types/wlr_cursor.h>
@@ -827,8 +826,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
wl_event_source_timer_update(view->urgent_timer,
config->urgent_timeout);
} else {
- sway_log(SWAY_ERROR, "Unable to create urgency timer (%s)",
- strerror(errno));
+ sway_log_errno(SWAY_ERROR, "Unable to create urgency timer");
handle_urgent_timeout(view);
}
} else {