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:
15b1248
)
main: make sure set_machine_id() doesn't clobber arg_machine_id on failure
author
Lennart Poettering
<lennart@poettering.net>
Thu, 21 Jul 2016 18:22:42 +0000
(20:22 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 22 Jul 2016 10:59:36 +0000
(12:59 +0200)
src/core/main.c
patch
|
blob
|
history
diff --git
a/src/core/main.c
b/src/core/main.c
index
fc04fb8
..
fa02455
100644
(file)
--- a/
src/core/main.c
+++ b/
src/core/main.c
@@
-291,14
+291,16
@@
static int parse_crash_chvt(const char *value) {
}
static int set_machine_id(const char *m) {
+ sd_id128_t t;
assert(m);
- if (sd_id128_from_string(m, &
arg_machine_id
) < 0)
+ if (sd_id128_from_string(m, &
t
) < 0)
return -EINVAL;
- if (sd_id128_is_null(
arg_machine_id
))
+ if (sd_id128_is_null(
t
))
return -EINVAL;
+ arg_machine_id = t;
return 0;
}