mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-27 13:57:26 +03:00
Merge pull request #948 from phomes/master
logind: actually fail on OOM
This commit is contained in:
commit
6c269e6402
@ -109,20 +109,24 @@ int inhibitor_save(Inhibitor *i) {
|
|||||||
_cleanup_free_ char *cc = NULL;
|
_cleanup_free_ char *cc = NULL;
|
||||||
|
|
||||||
cc = cescape(i->who);
|
cc = cescape(i->who);
|
||||||
if (!cc)
|
if (!cc) {
|
||||||
r = -ENOMEM;
|
r = -ENOMEM;
|
||||||
else
|
goto fail;
|
||||||
fprintf(f, "WHO=%s\n", cc);
|
}
|
||||||
|
|
||||||
|
fprintf(f, "WHO=%s\n", cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i->why) {
|
if (i->why) {
|
||||||
_cleanup_free_ char *cc = NULL;
|
_cleanup_free_ char *cc = NULL;
|
||||||
|
|
||||||
cc = cescape(i->why);
|
cc = cescape(i->why);
|
||||||
if (!cc)
|
if (!cc) {
|
||||||
r = -ENOMEM;
|
r = -ENOMEM;
|
||||||
else
|
goto fail;
|
||||||
fprintf(f, "WHY=%s\n", cc);
|
}
|
||||||
|
|
||||||
|
fprintf(f, "WHY=%s\n", cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i->fifo_path)
|
if (i->fifo_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user