aboutsummaryrefslogtreecommitdiff
path: root/backend/session/logind.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/session/logind.c')
-rw-r--r--backend/session/logind.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/backend/session/logind.c b/backend/session/logind.c
index e01047e3..2f816b95 100644
--- a/backend/session/logind.c
+++ b/backend/session/logind.c
@@ -47,7 +47,7 @@ static int logind_take_device(struct wlr_session *base, const char *path) {
struct stat st;
if (stat(path, &st) < 0) {
- wlr_log(L_ERROR, "Failed to stat '%s'", path);
+ wlr_log(WLR_ERROR, "Failed to stat '%s'", path);
return -1;
}
@@ -55,14 +55,14 @@ static int logind_take_device(struct wlr_session *base, const char *path) {
session->path, "org.freedesktop.login1.Session", "TakeDevice",
&error, &msg, "uu", major(st.st_rdev), minor(st.st_rdev));
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to take device '%s': %s", path, error.message);
+ wlr_log(WLR_ERROR, "Failed to take device '%s': %s", path, error.message);
goto error;
}
int paused = 0;
ret = sd_bus_message_read(msg, "hb", &fd, &paused);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to parse D-Bus response for '%s': %s",
+ wlr_log(WLR_ERROR, "Failed to parse D-Bus response for '%s': %s",
path, strerror(-ret));
goto error;
}
@@ -71,7 +71,7 @@ static int logind_take_device(struct wlr_session *base, const char *path) {
// so we just clone it.
fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
if (fd == -1) {
- wlr_log(L_ERROR, "Failed to clone file descriptor for '%s': %s",
+ wlr_log(WLR_ERROR, "Failed to clone file descriptor for '%s': %s",
path, strerror(errno));
goto error;
}
@@ -91,7 +91,7 @@ static void logind_release_device(struct wlr_session *base, int fd) {
struct stat st;
if (fstat(fd, &st) < 0) {
- wlr_log(L_ERROR, "Failed to stat device '%d'", fd);
+ wlr_log(WLR_ERROR, "Failed to stat device '%d'", fd);
return;
}
@@ -99,7 +99,7 @@ static void logind_release_device(struct wlr_session *base, int fd) {
session->path, "org.freedesktop.login1.Session", "ReleaseDevice",
&error, &msg, "uu", major(st.st_rdev), minor(st.st_rdev));
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to release device '%d'", fd);
+ wlr_log(WLR_ERROR, "Failed to release device '%d'", fd);
}
sd_bus_error_free(&error);
@@ -123,7 +123,7 @@ static bool logind_change_vt(struct wlr_session *base, unsigned vt) {
"/org/freedesktop/login1/seat/self", "org.freedesktop.login1.Seat", "SwitchTo",
&error, &msg, "u", (uint32_t)vt);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to change to vt '%d'", vt);
+ wlr_log(WLR_ERROR, "Failed to change to vt '%d'", vt);
}
sd_bus_error_free(&error);
@@ -140,7 +140,7 @@ static bool find_session_path(struct logind_session *session) {
"/org/freedesktop/login1", "org.freedesktop.login1.Manager",
"GetSession", &error, &msg, "s", session->id);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to get session path: %s", strerror(-ret));
+ wlr_log(WLR_ERROR, "Failed to get session path: %s", strerror(-ret));
goto out;
}
@@ -148,7 +148,7 @@ static bool find_session_path(struct logind_session *session) {
ret = sd_bus_message_read(msg, "o", &path);
if (ret < 0) {
- wlr_log(L_ERROR, "Could not parse session path: %s", strerror(-ret));
+ wlr_log(WLR_ERROR, "Could not parse session path: %s", strerror(-ret));
goto out;
}
@@ -170,7 +170,7 @@ static bool session_activate(struct logind_session *session) {
session->path, "org.freedesktop.login1.Session", "Activate",
&error, &msg, "");
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to activate session");
+ wlr_log(WLR_ERROR, "Failed to activate session");
}
sd_bus_error_free(&error);
@@ -187,7 +187,7 @@ static bool take_control(struct logind_session *session) {
session->path, "org.freedesktop.login1.Session", "TakeControl",
&error, &msg, "b", false);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to take control of session");
+ wlr_log(WLR_ERROR, "Failed to take control of session");
}
sd_bus_error_free(&error);
@@ -204,7 +204,7 @@ static void release_control(struct logind_session *session) {
session->path, "org.freedesktop.login1.Session", "ReleaseControl",
&error, &msg, "");
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to release control of session");
+ wlr_log(WLR_ERROR, "Failed to release control of session");
}
sd_bus_error_free(&error);
@@ -224,7 +224,7 @@ static void logind_session_destroy(struct wlr_session *base) {
}
static int session_removed(sd_bus_message *msg, void *userdata, sd_bus_error *ret_error) {
- wlr_log(L_INFO, "SessionRemoved signal received");
+ wlr_log(WLR_INFO, "SessionRemoved signal received");
return 0;
}
@@ -237,7 +237,7 @@ static struct wlr_device *find_device(struct wlr_session *session, dev_t devnum)
}
}
- wlr_log(L_ERROR, "Tried to use dev_t %lu not opened by session",
+ wlr_log(WLR_ERROR, "Tried to use dev_t %lu not opened by session",
(unsigned long)devnum);
assert(0);
}
@@ -250,7 +250,7 @@ static int pause_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_e
const char *type;
ret = sd_bus_message_read(msg, "uus", &major, &minor, &type);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to parse D-Bus response for PauseDevice: %s",
+ wlr_log(WLR_ERROR, "Failed to parse D-Bus response for PauseDevice: %s",
strerror(-ret));
goto error;
}
@@ -265,7 +265,7 @@ static int pause_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_e
session->path, "org.freedesktop.login1.Session", "PauseDeviceComplete",
ret_error, &msg, "uu", major, minor);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to send PauseDeviceComplete signal: %s",
+ wlr_log(WLR_ERROR, "Failed to send PauseDeviceComplete signal: %s",
strerror(-ret));
}
}
@@ -282,7 +282,7 @@ static int resume_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_
uint32_t major, minor;
ret = sd_bus_message_read(msg, "uuh", &major, &minor, &fd);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to parse D-Bus response for ResumeDevice: %s",
+ wlr_log(WLR_ERROR, "Failed to parse D-Bus response for ResumeDevice: %s",
strerror(-ret));
goto error;
}
@@ -314,21 +314,21 @@ static bool add_signal_matches(struct logind_session *session) {
snprintf(str, sizeof(str), fmt, "Manager", "SessionRemoved", "/org/freedesktop/login1");
ret = sd_bus_add_match(session->bus, NULL, str, session_removed, session);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to add D-Bus match: %s", strerror(-ret));
+ wlr_log(WLR_ERROR, "Failed to add D-Bus match: %s", strerror(-ret));
return false;
}
snprintf(str, sizeof(str), fmt, "Session", "PauseDevice", session->path);
ret = sd_bus_add_match(session->bus, NULL, str, pause_device, session);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to add D-Bus match: %s", strerror(-ret));
+ wlr_log(WLR_ERROR, "Failed to add D-Bus match: %s", strerror(-ret));
return false;
}
snprintf(str, sizeof(str), fmt, "Session", "ResumeDevice", session->path);
ret = sd_bus_add_match(session->bus, NULL, str, resume_device, session);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to add D-Bus match: %s", strerror(-ret));
+ wlr_log(WLR_ERROR, "Failed to add D-Bus match: %s", strerror(-ret));
return false;
}
@@ -347,20 +347,20 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) {
int ret;
struct logind_session *session = calloc(1, sizeof(*session));
if (!session) {
- wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno));
+ wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno));
return NULL;
}
ret = sd_pid_get_session(getpid(), &session->id);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to get session id: %s", strerror(-ret));
+ wlr_log(WLR_ERROR, "Failed to get session id: %s", strerror(-ret));
goto error;
}
char *seat;
ret = sd_session_get_seat(session->id, &seat);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to get seat id: %s", strerror(-ret));
+ wlr_log(WLR_ERROR, "Failed to get seat id: %s", strerror(-ret));
goto error;
}
snprintf(session->base.seat, sizeof(session->base.seat), "%s", seat);
@@ -368,7 +368,7 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) {
if (strcmp(seat, "seat0") == 0) {
ret = sd_session_get_vt(session->id, &session->base.vtnr);
if (ret < 0) {
- wlr_log(L_ERROR, "Session not running in virtual terminal");
+ wlr_log(WLR_ERROR, "Session not running in virtual terminal");
goto error;
}
}
@@ -376,7 +376,7 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) {
ret = sd_bus_default_system(&session->bus);
if (ret < 0) {
- wlr_log(L_ERROR, "Failed to open D-Bus connection: %s", strerror(-ret));
+ wlr_log(WLR_ERROR, "Failed to open D-Bus connection: %s", strerror(-ret));
goto error;
}
@@ -401,7 +401,7 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) {
goto error_bus;
}
- wlr_log(L_INFO, "Successfully loaded logind session");
+ wlr_log(WLR_INFO, "Successfully loaded logind session");
session->base.impl = &session_logind;
return &session->base;