mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 02:55:55 +02:00
installer: Create target directory when mounting something
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user