]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
installer: Create target directory when mounting something
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 Jul 2014 13:16:33 +0000 (15:16 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 Jul 2014 13:16:33 +0000 (15:16 +0200)
src/install+setup/install/hw.c

index 2c5ae522fe64ebda6fef50c7883b6ea58a4dde2d..36d881b0c8901a70b3ec08b6396aa6942d2ac93d 100644 (file)
@@ -81,6 +81,10 @@ static int strstartswith(const char* a, const char* b) {
 }
 
 int hw_mount(const char* source, const char* target, const char* fs, int flags) {
+       // Create target if it does not exist
+       if (access(target, X_OK) != 0)
+               mkdir(target, S_IRWXU|S_IRWXG|S_IRWXO);
+
        return mount(source, target, fs, flags, NULL);
 }