[systemd-commits] 2 commits - src/login src/nspawn
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Mar 11 09:46:03 PDT 2014
src/login/logind-action.c | 4 +++-
src/login/logind-core.c | 2 +-
src/nspawn/nspawn.c | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 94036de887ad5b0dc805abe38b5c1c58b57d9465
Author: Mantas MikulÄnas <grawity at gmail.com>
Date: Tue Mar 11 17:49:00 2014 +0200
logind: Do not fail display count if a device has no parent
udev_device_get_parent() may return NULL when the device doesn't have a
parent, as is the case with (for example) /sys/devices/virtual/drm/ttm.
Also, log an actual error message instead of "-12 displays connected".
diff --git a/src/login/logind-action.c b/src/login/logind-action.c
index ae7b350..1928f43 100644
--- a/src/login/logind-action.c
+++ b/src/login/logind-action.c
@@ -84,7 +84,9 @@ int manager_handle_action(
* treat like this under the assumption that there is
* no modern drm driver available. */
n = manager_count_displays(m);
- if (n != 1) {
+ if (n < 0)
+ log_warning("Display counting failed: %s", strerror(-n));
+ else if (n != 1) {
log_debug("Ignoring lid switch request, %i displays connected.", n);
return 0;
}
diff --git a/src/login/logind-core.c b/src/login/logind-core.c
index ca34d37..053d2ed 100644
--- a/src/login/logind-core.c
+++ b/src/login/logind-core.c
@@ -520,7 +520,7 @@ int manager_count_displays(Manager *m) {
p = udev_device_get_parent(d);
if (!p)
- return -ENOMEM;
+ continue;
/* If the parent shares the same subsystem as the
* device we are looking at then it is a connector,
commit 4de82926892eb1636d0a25cf1e4ab15cab6a6099
Author: Mantas MikulÄnas <grawity at gmail.com>
Date: Tue Mar 11 18:00:13 2014 +0200
nspawn: fix argv[0] for getent
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 1051b92..b2c974d 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2275,8 +2275,8 @@ static int spawn_getent(const char *database, const char *key, pid_t *rpid) {
reset_all_signal_handlers();
close_all_fds(NULL, 0);
- execle("/usr/bin/getent", "getenv", database, key, NULL, &empty_env);
- execle("/bin/getent", "getenv", database, key, NULL, &empty_env);
+ execle("/usr/bin/getent", "getent", database, key, NULL, &empty_env);
+ execle("/bin/getent", "getent", database, key, NULL, &empty_env);
_exit(EXIT_FAILURE);
}
More information about the systemd-commits
mailing list