diff options
Diffstat (limited to 'libfstools/mount.c')
-rw-r--r-- | libfstools/mount.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libfstools/mount.c b/libfstools/mount.c index 1691ce7..3d4111f 100644 --- a/libfstools/mount.c +++ b/libfstools/mount.c @@ -143,8 +143,11 @@ fopivot(char *rw_root, char *ro_root) * We can't really deal with these constraints without * creating two new subdirectories in /overlay. */ - mkdir(upperdir, 0755); - mkdir(workdir, 0755); + if (mkdir(upperdir, 0755) == -1 && errno != EEXIST) + return -1; + + if (mkdir(workdir, 0755) == -1 && errno != EEXIST) + return -1; if (stat(upgrade, &st) == 0) rename(upgrade, upgrade_dest); |