Merge pull request #3509 from ianyfan/log-errno

Use sway_log_errno instead of strerror
master
Drew DeVault 6 years ago committed by GitHub
commit 5f45a4bbc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,7 @@
#define _POSIX_C_SOURCE 200809 #define _POSIX_C_SOURCE 200809L
#include <libgen.h> #include <libgen.h>
#include <stdio.h>
#include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h> #include <unistd.h>
#include <wordexp.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; bool can_access = access(src, F_OK) != -1;
if (!can_access) { if (!can_access) {
sway_log(SWAY_ERROR, "Unable to access background file '%s': %s", sway_log_errno(SWAY_ERROR, "Unable to access background file '%s'",
src, strerror(errno)); src);
config_add_swaynag_warning("Unable to access background file '%s'", config_add_swaynag_warning("Unable to access background file '%s'",
src); src);
free(src); free(src);

@ -1,6 +1,4 @@
#define _POSIX_C_SOURCE 200809L #define _POSIX_C_SOURCE 200809L
#include <errno.h>
#include <limits.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -449,9 +447,8 @@ static void transaction_commit(struct sway_transaction *transaction) {
wl_event_source_timer_update(transaction->timer, wl_event_source_timer_update(transaction->timer,
server.txn_timeout_ms); server.txn_timeout_ms);
} else { } else {
sway_log(SWAY_ERROR, "Unable to create transaction timer (%s). " sway_log_errno(SWAY_ERROR, "Unable to create transaction timer "
"Some imperfect frames might be rendered.", "(some imperfect frames might be rendered)");
strerror(errno));
transaction->num_waiting = 0; transaction->num_waiting = 0;
} }
} }

@ -1,7 +1,6 @@
#define _POSIX_C_SOURCE 200809L #define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <errno.h>
#include <linux/input-event-codes.h> #include <linux/input-event-codes.h>
#include <string.h>
#include <strings.h> #include <strings.h>
#include <time.h> #include <time.h>
#include <wlr/types/wlr_cursor.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, wl_event_source_timer_update(view->urgent_timer,
config->urgent_timeout); config->urgent_timeout);
} else { } else {
sway_log(SWAY_ERROR, "Unable to create urgency timer (%s)", sway_log_errno(SWAY_ERROR, "Unable to create urgency timer");
strerror(errno));
handle_urgent_timeout(view); handle_urgent_timeout(view);
} }
} else { } else {

Loading…
Cancel
Save