diff options
Diffstat (limited to 'src/cryptsetup/cryptsetup-generator.c')
-rw-r--r-- | src/cryptsetup/cryptsetup-generator.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index c3a4509030..892e41ce18 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -54,16 +54,16 @@ static int generate_keydev_mount(const char *name, const char *keydev, char **un return r; r = mkdir("/run/systemd/cryptsetup", 0700); - if (r < 0) - return r; + if (r < 0 && errno != EEXIST) + return -errno; where = strjoin("/run/systemd/cryptsetup/keydev-", name); if (!where) return -ENOMEM; r = mkdir(where, 0700); - if (r < 0) - return r; + if (r < 0 && errno != EEXIST) + return -errno; r = unit_name_from_path(where, ".mount", &u); if (r < 0) |