projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
65bc2c2
)
util: don't fail if no id was passed to detect_container()
author
Lennart Poettering
<lennart@poettering.net>
Fri, 23 Sep 2011 03:33:33 +0000
(
05:33
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 23 Sep 2011 14:28:27 +0000
(16:28 +0200)
src/util.c
patch
|
blob
|
history
diff --git
a/src/util.c
b/src/util.c
index
33b6fd4
..
ed3b8d4
100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-4445,17
+4445,23
@@
int detect_container(const char **id) {
if (streq(line, "container=lxc")) {
fclose(f);
- *id = "lxc";
+
+ if (id)
+ *id = "lxc";
return 1;
} else if (streq(line, "container=systemd-nspawn")) {
fclose(f);
- *id = "systemd-nspawn";
+
+ if (id)
+ *id = "systemd-nspawn";
return 1;
} else if (startswith(line, "container=")) {
fclose(f);
- *id = "other-container";
+
+ if (id)
+ *id = "other-container";
return 1;
}