From 85f2892b2a0ea2a2d0f6ab44ffcbe72ae91c41a2 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 27 Jul 2014 15:16:33 +0200 Subject: [PATCH] installer: Create target directory when mounting something --- src/install+setup/install/hw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/install+setup/install/hw.c b/src/install+setup/install/hw.c index 2c5ae522f..36d881b0c 100644 --- a/src/install+setup/install/hw.c +++ b/src/install+setup/install/hw.c @@ -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); }