chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
cadef8d
)
sd-login: fix querying machines when machined is not running
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Fri, 19 May 2017 11:52:00 +0000
(07:52 -0400)
committer
Sven Eden
<yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:52 +0000
(09:46 +0200)
We should not leak the internal error from missing directory and treat
that case the same as no machines.
src/libelogind/sd-login/sd-login.c
patch
|
blob
|
history
diff --git
a/src/libelogind/sd-login/sd-login.c
b/src/libelogind/sd-login/sd-login.c
index 794136304b7a26ec0e91525e7045e0b909b65251..96d7e447af1118969867d8bc65404becbcc16270 100644
(file)
--- a/
src/libelogind/sd-login/sd-login.c
+++ b/
src/libelogind/sd-login/sd-login.c
@@
-910,6
+910,10
@@
_public_ int sd_get_machine_names(char ***machines) {
assert_return(machines, -EINVAL);
r = get_files_in_directory("/run/systemd/machines/", &l);
+ if (r == -ENOENT) {
+ *machines = NULL;
+ return 0;
+ }
if (r < 0)
return r;