diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-11-18 23:31:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-11-22 13:35:09 +0100 |
commit | 546dbec532b49ddb649d364c7b9e9e91d7b377f0 (patch) | |
tree | 4b7fea80b3c27f8b0cf02268a0360dddf8672765 | |
parent | 0f3be6ca4dbbac8350cd8f10a8968d31f7bc13b6 (diff) |
shared: make sure image_path_lock() return parameters are always initialized on success
We forgot to initialize the "global" return parameter in one case. Fix that.
-rw-r--r-- | src/shared/machine-image.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index 6414ba5246..af102e3096 100644 --- a/src/shared/machine-image.c +++ b/src/shared/machine-image.c @@ -27,6 +27,7 @@ #include <sys/stat.h> #include <unistd.h> #include <linux/fs.h> + #include "alloc-util.h" #include "btrfs-util.h" #include "chattr-util.h" @@ -37,8 +38,8 @@ #include "hashmap.h" #include "lockfile-util.h" #include "log.h" -#include "macro.h" #include "machine-image.h" +#include "macro.h" #include "mkdir.h" #include "path-util.h" #include "rm-rf.h" @@ -746,7 +747,8 @@ int image_path_lock(const char *path, int operation, LockFile *global, LockFile release_lock_file(&t); return r; } - } + } else + *global = (LockFile) LOCK_FILE_INIT; *local = t; return 0; |